[gtk: 2/3] wayland/surface: Destroy toplevel present callback if ignored




commit c27f811462c59617842da3b3a0edefbc97500400
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Aug 7 09:03:03 2020 +0200

    wayland/surface: Destroy toplevel present callback if ignored
    
    We might break the loop early, e.g. if we're unmapped before the round
    trip finishes, and to avoid the callback to write to invalid stack
    memory, destroy the callback so it won't be invoked.
    
    Fixes: #3026

 gdk/wayland/gdksurface-wayland.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index fccfa9a003..527e27f7df 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -4814,6 +4814,9 @@ gdk_wayland_toplevel_present (GdkToplevel       *toplevel,
          (!impl->initial_configure_received || !done))
     wl_display_dispatch_queue (display_wayland->wl_display, impl->event_queue);
 
+  if (!done)
+    wl_callback_destroy (callback);
+
   if (needs_reconfigure &&
       last_configure_serial == impl->last_configure_serial &&
       !(surface->state & (GDK_SURFACE_STATE_MAXIMIZED |


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