[weston,v3,10/15] ivi-shell: remove surface_destroy_listener

Submitted by Michael Teyfel on April 10, 2018, 9:05 a.m.

Details

Message ID 1523351122-4538-1-git-send-email-mteyfel@de.adit-jv.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Michael Teyfel April 10, 2018, 9:05 a.m.
Since the surface_destroy_listener is only registered for ivi-shell
applications, it should only be removed for ivi-shell applications.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
---
 ivi-shell/ivi-shell.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index 5c011d9..160c41c 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -156,6 +156,10 @@  layout_surface_cleanup(struct ivi_shell_surface *ivisurf)
 {
 	assert(ivisurf->layout_surface != NULL);
 
+	/* destroy weston_surface destroy signal. */
+	if (!ivisurf->layout_surface->weston_desktop_surface)
+		wl_list_remove(&ivisurf->surface_destroy_listener.link);
+
 	ivi_layout_surface_destroy(ivisurf->layout_surface);
 	ivisurf->layout_surface = NULL;
 
@@ -163,9 +167,6 @@  layout_surface_cleanup(struct ivi_shell_surface *ivisurf)
 	ivisurf->surface->committed_private = NULL;
 	weston_surface_set_label_func(ivisurf->surface, NULL);
 	ivisurf->surface = NULL;
-
-	// destroy weston_surface destroy signal.
-	wl_list_remove(&ivisurf->surface_destroy_listener.link);
 }
 
 /*