From 77107f70c4fb0751653fe20a8d3de0195ff53fcc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 16 May 2020 13:47:18 -0400 Subject: [PATCH] broadway: Be careful about destroyed surfaces 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c index 1b85f29825..ac91d2887f 100644 --- a/gdk/broadway/gdksurface-broadway.c +++ b/gdk/broadway/gdksurface-broadway.c @@ -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; }