diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-10-21 09:43:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-21 09:43:24 -0400 |
commit | 3c7ef3aae68e1a38c0ab83c22c0e064b7bde319e (patch) | |
tree | ca85d4ac1f277ca0f997bcffb7adfe36e5157205 /rootston/desktop.c | |
parent | a87b60e31e5288c1c3e8c8f94c9a7ccb29e38b54 (diff) | |
parent | ce2f945441155fa9d98935dabd6979304f2d2fbc (diff) |
Merge branch 'master' into feature/data-device-selection
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r-- | rootston/desktop.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c index 641315a8..70767f92 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -202,17 +202,23 @@ struct roots_view *view_at(struct roots_desktop *desktop, double lx, double ly, struct roots_desktop *desktop_create(struct roots_server *server, struct roots_config *config) { - struct roots_desktop *desktop = calloc(1, sizeof(struct roots_desktop)); wlr_log(L_DEBUG, "Initializing roots desktop"); - assert(desktop->views = list_create()); + struct roots_desktop *desktop = calloc(1, sizeof(struct roots_desktop)); + if (desktop == NULL) { + return NULL; + } + + desktop->views = list_create(); + if (desktop->views == NULL) { + free(desktop); + return NULL; + } wl_list_init(&desktop->outputs); - wl_list_init(&desktop->output_add.link); - desktop->output_add.notify = output_add_notify; - wl_list_init(&desktop->output_remove.link); - desktop->output_remove.notify = output_remove_notify; + desktop->output_add.notify = output_add_notify; wl_signal_add(&server->backend->events.output_add, &desktop->output_add); + desktop->output_remove.notify = output_remove_notify; wl_signal_add(&server->backend->events.output_remove, &desktop->output_remove); |