[gtk+/quartz-integration] Null out the target_list and source_widget pointers on a changeOwner, and prevent provideDataForType



commit 4d4cdc70d5b447d12aaf521ecf6e6a511ffa5c50
Author: John Ralls <jralls ceridwen us>
Date:   Fri Dec 31 17:15:32 2010 -0800

    Null out the target_list and source_widget pointers on a changeOwner, and prevent provideDataForType from doing anything (like crashing)if they've been nulled.

 gtk/gtkdnd-quartz.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index f9bec1e..39a47a9 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -142,7 +142,8 @@ struct _GtkDragFindData
 {
   guint target_info;
   GtkSelectionData selection_data;
-
+  g_return_if_fail(info->source_widget != NULL);
+  g_return_if_fail(info->target_list != NULL);
   selection_data.selection = GDK_NONE;
   selection_data.data = NULL;
   selection_data.length = -1;
@@ -165,6 +166,13 @@ struct _GtkDragFindData
     }
 }
 
+- (void)pasteboardChangedOwner: (NSPasteboard*)sender
+{
+    info->target_list = NULL;
+    info->widget = NULL;
+    info->source_widget = NULL;
+}
+
 - (id)initWithInfo:(GtkDragSourceInfo *)anInfo
 {
   self = [super init];



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