[gtk/wip/matthiasc/popup5: 170/187] surface: Don't dispose the frame clock prematurely



commit 2412c32821e2e79a4080e6830f79c685cf83ad49
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon May 20 13:19:12 2019 +0000

    surface: Don't dispose the frame clock prematurely
    
    Since we are now sharing frame clocks with multiple
    surfaces, we can no longer dispose them unconditionally
    when a surface goes away. Only do it if we are a
    toplevel (without parent).
    
    This was showing up as criticals on exit when opening
    and closing any popover in widget factory.

 gdk/gdksurface.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 4a8e2cde7b..eae2f314f9 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -893,7 +893,8 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface,
 
   if (surface->frame_clock)
     {
-      g_object_run_dispose (G_OBJECT (surface->frame_clock));
+      if (surface->parent == NULL)
+        g_object_run_dispose (G_OBJECT (surface->frame_clock));
       gdk_surface_set_frame_clock (surface, NULL);
     }
 
@@ -3801,6 +3802,7 @@ gdk_surface_set_frame_clock (GdkSurface     *surface,
   if (clock == surface->frame_clock)
     return;
 
+g_print ("surface set frame clock %p\n", clock);
   if (clock)
     {
       g_object_ref (clock);


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