broadway: Be careful about destroyed surfaces
authorMatthias Clasen <mclasen@redhat.com>
Sat, 16 May 2020 17:47:18 +0000 (13:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 16 May 2020 17:47:18 +0000 (13:47 -0400)
Just because we take a ref on a surface does not
guarantee that it is still usable a second later.
Check if its been destroyed in the meantime.

This is breaking the template tests in ci, since
there is no client behind the Broadway server.

gdk/broadway/gdksurface-broadway.c

index 1b85f29825b9cb6530843c9a8022e8c55030ecbb..ac91d2887f1cc4995f66a5c3bd8d2ebdc93f9d07 100644 (file)
@@ -99,7 +99,8 @@ gdk_broadway_surface_finalize (GObject *object)
 static gboolean
 thaw_updates_cb (GdkSurface *surface)
 {
-  gdk_surface_thaw_updates (surface);
+  if (!GDK_SURFACE_DESTROYED (surface))
+    gdk_surface_thaw_updates (surface);
   g_object_unref (surface);
   return G_SOURCE_REMOVE;
 }