From 98d1b5464d7d5a8db6bb02d4544afe7960dfa7fe Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 31 Jan 2014 16:24:19 -0500 Subject: [PATCH] gdkwindow-wayland: Bail out early if we get a frame callback when destroying our window This prevents warnings like (gtk3-demo:14948): Gdk-CRITICAL **: _gdk_frame_clock_thaw: assertion 'GDK_IS_FRAME_CLOCK (clock)' failed (gtk3-demo:14948): Gdk-CRITICAL **: gdk_frame_clock_get_timings: assertion 'GDK_IS_FRAME_CLOCK (frame_clock)' failed We need to do this, as the compositor might have already sent us a frame event, in-flight, at the same time we destroy our window. In this case, we'll receive the then-in-flight "done" event, and then warn as we try to look up the frame clock on a destroyed window. --- gdk/wayland/gdkwindow-wayland.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 13293bd4d6..ec51f590a7 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -403,6 +403,10 @@ on_frame_clock_after_paint (GdkFrameClock *clock, return; impl->pending_commit = FALSE; + + if (GDK_WINDOW_DESTROYED (window)) + return; + impl->pending_frame_counter = gdk_frame_clock_get_frame_counter (clock); callback = wl_surface_frame (impl->surface);