[gtk+] gdkwindow-wayland: Bail out early if we get a frame callback when destroying our window



commit 98d1b5464d7d5a8db6bb02d4544afe7960dfa7fe
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Jan 31 16:24:19 2014 -0500

    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 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 13293bd..ec51f59 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]