diff options
author | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> | 2015-06-22 15:30:53 +0900 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-06-23 15:57:15 +0300 |
commit | 6f6c9389967d0fa2e96cd091805682124f554293 (patch) | |
tree | 7173704028ad35aa03670175f21892aeda429bfd /ivi-shell/ivi-shell.c | |
parent | 0c217cb694ebf5a840f7b8cd026b466c6bd08425 (diff) |
ivi-shell: make ivi_layout_surface destruction explicit
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'ivi-shell/ivi-shell.c')
-rw-r--r-- | ivi-shell/ivi-shell.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index f9c25839..a1473530 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -130,6 +130,22 @@ ivi_shell_surface_configure(struct weston_surface *surface, } } +static void +layout_surface_cleanup(struct ivi_shell_surface *ivisurf) +{ + assert(ivisurf->layout_surface != NULL); + + ivi_layout_surface_destroy(ivisurf->layout_surface); + ivisurf->layout_surface = NULL; + + ivisurf->surface->configure = NULL; + ivisurf->surface->configure_private = NULL; + ivisurf->surface = NULL; + + // destroy weston_surface destroy signal. + wl_list_remove(&ivisurf->surface_destroy_listener.link); +} + /* * The ivi_surface wl_resource destructor. * @@ -154,14 +170,8 @@ shell_handle_surface_destroy(struct wl_listener *listener, void *data) assert(ivisurf != NULL); - if (ivisurf->surface!=NULL) { - ivisurf->surface->configure = NULL; - ivisurf->surface->configure_private = NULL; - ivisurf->surface = NULL; - } - - wl_list_remove(&ivisurf->surface_destroy_listener.link); - wl_list_remove(&ivisurf->link); + if (ivisurf->layout_surface != NULL) + layout_surface_cleanup(ivisurf); if (ivisurf->resource != NULL) { wl_resource_set_user_data(ivisurf->resource, NULL); |