wayland/surface: Fix crash when unexporting
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 1 Oct 2019 19:13:43 +0000 (16:13 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 1 Oct 2019 19:13:43 +0000 (16:13 -0300)
This is the exact same problem of 655c9dd526.

gdk/wayland/gdksurface-wayland.c

index aed4489c7cf2c8489ad96b1f9debee647dd08ee4..80e12e29cec85deb04dd72fb2130fe4f0ef97f44 100644 (file)
@@ -4184,8 +4184,11 @@ gdk_wayland_surface_unexport_handle (GdkSurface *surface)
 
   g_clear_pointer (&impl->display_server.xdg_exported,
                    zxdg_exported_v1_destroy);
-  g_clear_pointer (&impl->exported.user_data,
-                   impl->exported.destroy_func);
+  if (impl->exported.destroy_func)
+    {
+      g_clear_pointer (&impl->exported.user_data,
+                       impl->exported.destroy_func);
+    }
 }
 
 static void