summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd-quartz.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2009-12-30 14:18:33 +0100
committerKristian Rietveld <kris@gtk.org>2009-12-30 14:18:33 +0100
commitf91907101d12f4f8808f4024b462820543ccccf6 (patch)
treeacd0b019b274107eb608d6d4f2307867bca3c8d5 /gtk/gtkdnd-quartz.c
parentc12dbae0ac69d93376fb2091f4919ee36ba3348b (diff)
downloadgtk+-f91907101d12f4f8808f4024b462820543ccccf6.tar.gz
Fix memory management of types array
Also add autorelease pool to gtk_drag_begin_idle().
Diffstat (limited to 'gtk/gtkdnd-quartz.c')
-rw-r--r--gtk/gtkdnd-quartz.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index 275ebba0bd..f01a71fd34 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -455,7 +455,9 @@ register_types (GtkWidget *widget, GtkDragDestSite *site)
pool = [[NSAutoreleasePool alloc] init];
types = _gtk_quartz_target_list_to_pasteboard_types (site->target_list);
- [nswindow registerForDraggedTypes:types];
+ [nswindow registerForDraggedTypes:[types copy]];
+
+ [types release];
[pool release];
}
}
@@ -1063,6 +1065,7 @@ gtk_drag_dest_find_target (GtkWidget *widget,
static gboolean
gtk_drag_begin_idle (gpointer arg)
{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
GdkDragContext* context = (GdkDragContext*) arg;
GtkDragSourceInfo* info = gtk_drag_get_source_info (context, FALSE);
NSWindow *nswindow;
@@ -1096,6 +1099,8 @@ gtk_drag_begin_idle (gpointer arg)
[info->nsevent release];
+ [pool release];
+
return FALSE;
}