summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIskren Chernev <iskren.chernev@gmail.com>2011-03-11 14:19:00 +0200
committerKristian Høgsberg <krh@bitplanet.net>2011-03-12 21:56:13 -0500
commitc9a729260fd1397a625c98f7284b2f1f44a95081 (patch)
treef44e2ba7bdba81e23a5bc9c07044cbba22c9797b
parent9061f91eb8252e1e414365df7e909093932235ac (diff)
Better cleanup on display creation failure.
-rw-r--r--wayland/wayland-server.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/wayland/wayland-server.c b/wayland/wayland-server.c
index dece0d1..17b91ae 100644
--- a/wayland/wayland-server.c
+++ b/wayland/wayland-server.c
@@ -528,6 +528,7 @@ wl_display_create(void)
display->objects = wl_hash_table_create();
if (display->objects == NULL) {
+ wl_event_loop_destroy(display->loop);
free(display);
return NULL;
}
@@ -544,6 +545,7 @@ wl_display_create(void)
wl_display_add_object(display, &display->object);
if (wl_display_add_global(display, &display->object, NULL)) {
wl_event_loop_destroy(display->loop);
+ wl_hash_table_destroy(display->objects);
free(display);
return NULL;
}