ecore-wl2: null out subsurface pointers after destroying them
authorMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 5 May 2016 14:35:18 +0000 (10:35 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 5 May 2016 14:49:30 +0000 (10:49 -0400)
src/lib/ecore_wl2/ecore_wl2_subsurf.c

index b18c9f3..980c2ee 100644 (file)
@@ -5,12 +5,20 @@
 #include "ecore_wl2_private.h"
 
 void
+_ecore_wl2_subsurf_unmap(Ecore_Wl2_Subsurface *subsurf)
+{
+   if (subsurf->wl.subsurface) wl_subsurface_destroy(subsurf->wl.subsurface);
+   if (subsurf->wl.surface) wl_surface_destroy(subsurf->wl.surface);
+   subsurf->wl.subsurface = NULL;
+   subsurf->wl.surface = NULL;
+}
+
+void
 _ecore_wl2_subsurf_free(Ecore_Wl2_Subsurface *subsurf)
 {
    Ecore_Wl2_Window *parent;
 
-   if (subsurf->wl.subsurface) wl_subsurface_destroy(subsurf->wl.subsurface);
-   if (subsurf->wl.surface) wl_surface_destroy(subsurf->wl.surface);
+   _ecore_wl2_subsurf_unmap(subsurf);
 
    parent = subsurf->parent;
    if (parent)