diff options
Diffstat (limited to 'ivi-shell/ivi-shell.c')
-rw-r--r-- | ivi-shell/ivi-shell.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index 99431d0b..d3b5cde2 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -623,10 +623,14 @@ wet_shell_init(struct weston_compositor *compositor, if (shell == NULL) return -1; - init_ivi_shell(compositor, shell); + if (!weston_compositor_add_destroy_listener_once(compositor, + &shell->destroy_listener, + shell_destroy)) { + free(shell); + return 0; + } - shell->destroy_listener.notify = shell_destroy; - wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener); + init_ivi_shell(compositor, shell); shell->wake_listener.notify = wake_handler; wl_signal_add(&compositor->wake_signal, &shell->wake_listener); |