Commit f9190710 authored by Kristian Rietveld's avatar Kristian Rietveld

Fix memory management of types array

Also add autorelease pool to gtk_drag_begin_idle().
parent c12dbae0
......@@ -370,7 +370,7 @@ gtk_clipboard_set_contents (GtkClipboard *clipboard,
clipboard->target_list = gtk_target_list_new (targets, n_targets);
[clipboard->pasteboard declareTypes:types owner:owner];
[types release];
[pool release];
return TRUE;
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment