aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-10-21 13:25:39 +0200
committeremersion <contact@emersion.fr>2017-10-21 13:25:39 +0200
commitf2c4b80620337e8533ce0986186cc914d45b6dce (patch)
tree857b637159fda78fccf048093678266ca3dd9d0f /rootston/desktop.c
parentc8570d0e426c60fb66fba4ccc8e74af73933e615 (diff)
Remove calls to assert to check runtime errors in rootston
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index bf556131..70767f92 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -202,11 +202,18 @@ 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));
- assert(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);
desktop->output_add.notify = output_add_notify;