[gtk/gtk-3-24: 1/2] quartz: Add missing g_object_ref



commit b7ec3b163f6259c60a178087a4ff1b4df6538455
Author: James Westman <flyingpimonster flyingpimonster net>
Date:   Sun Apr 21 21:14:15 2019 -0500

    quartz: Add missing g_object_ref
    
    A g_object_ref() call was missing, sometimes causing crashes during
    drag-and-drop operations. The matching g_object_unref() is at
    gdk/gdkdnd.c:261.
    
    The logic in this function is still wrong--it finds the wrong GdkWindow under
    some circumstances--but this commit fixes the crash.
    
    Part of #1840.

 gdk/quartz/GdkQuartzNSWindow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c
index 8d1ba4af2b..6de26b001b 100644
--- a/gdk/quartz/GdkQuartzNSWindow.c
+++ b/gdk/quartz/GdkQuartzNSWindow.c
@@ -788,7 +788,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
           wh = gdk_window_get_height (win);
 
           if (gx > wx && gy > wy && gx <= wx + ww && gy <= wy + wh)
-            event->dnd.context->dest_window = win;
+            event->dnd.context->dest_window = g_object_ref (win);
+            break;
         }
     }
 


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