diff options
author | random human <random.bored.human@gmail.com> | 2018-09-02 22:23:02 +0530 |
---|---|---|
committer | random human <random.bored.human@gmail.com> | 2018-09-03 02:43:55 +0530 |
commit | 568b0ffe2c84c4ac4f21287a29ec55d3530346f4 (patch) | |
tree | f8a0d4819317df03dece6a3e2bec3f7fa910e850 | |
parent | 7105864e13c7a83f57d22edce619fe511a9d1342 (diff) |
Call wl_global_create first in case of failure
-rw-r--r-- | types/tablet_v2/wlr_tablet_v2.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/types/tablet_v2/wlr_tablet_v2.c b/types/tablet_v2/wlr_tablet_v2.c index 45036839..e53b8051 100644 --- a/types/tablet_v2/wlr_tablet_v2.c +++ b/types/tablet_v2/wlr_tablet_v2.c @@ -294,13 +294,6 @@ struct wlr_tablet_manager_v2 *wlr_tablet_v2_create(struct wl_display *display) { return NULL; } - wl_signal_init(&tablet->events.destroy); - wl_list_init(&tablet->clients); - wl_list_init(&tablet->seats); - - tablet->display_destroy.notify = handle_display_destroy; - wl_display_add_destroy_listener(display, &tablet->display_destroy); - tablet->wl_global = wl_global_create(display, &zwp_tablet_manager_v2_interface, TABLET_MANAGER_VERSION, tablet, tablet_v2_bind); @@ -309,5 +302,12 @@ struct wlr_tablet_manager_v2 *wlr_tablet_v2_create(struct wl_display *display) { return NULL; } + wl_signal_init(&tablet->events.destroy); + wl_list_init(&tablet->clients); + wl_list_init(&tablet->seats); + + tablet->display_destroy.notify = handle_display_destroy; + wl_display_add_destroy_listener(display, &tablet->display_destroy); + return tablet; } |