mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-24 06:59:50 -05:00
Better cleanup on display creation failure.
This commit is contained in:
parent
9061f91eb8
commit
c9a729260f
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue