diff options
author | Kristian Rietveld <kris@gtk.org> | 2010-01-01 20:39:57 +0100 |
---|---|---|
committer | Kristian Rietveld <kris@gtk.org> | 2010-01-01 21:28:16 +0100 |
commit | c049c6a38507fe4279a51422fb65d77cd8be8b8a (patch) | |
tree | 2eebf44eab8936eddc89ab4fcd3b4294e6165e98 /gtk/gtkquartz.c | |
parent | 693124500386628e2a26533bcfbb453b10d253ae (diff) | |
download | gtk+-c049c6a38507fe4279a51422fb65d77cd8be8b8a.tar.gz |
Rework a previous commit to not crash in addition to fixing leaks
The target list/entry to pasteboard entry conversions return a NSSet
now instead of NSArray.
Diffstat (limited to 'gtk/gtkquartz.c')
-rw-r--r-- | gtk/gtkquartz.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/gtk/gtkquartz.c b/gtk/gtkquartz.c index 6a94c3fd3b..dcc8ee0c9a 100644 --- a/gtk/gtkquartz.c +++ b/gtk/gtkquartz.c @@ -83,11 +83,10 @@ target_to_pasteboard_type (const char *target) return [NSString stringWithUTF8String:target]; } -NSArray * +NSSet * _gtk_quartz_target_list_to_pasteboard_types (GtkTargetList *target_list) { NSMutableSet *set = [[NSMutableSet alloc] init]; - NSArray *ret; GList *list; for (list = target_list->list; list; list = list->next) @@ -98,19 +97,14 @@ _gtk_quartz_target_list_to_pasteboard_types (GtkTargetList *target_list) g_free (target); } - ret = [set allObjects]; - - [set release]; - - return ret; + return set; } -NSArray * +NSSet * _gtk_quartz_target_entries_to_pasteboard_types (const GtkTargetEntry *targets, guint n_targets) { NSMutableSet *set = [[NSMutableSet alloc] init]; - NSArray *ret; int i; for (i = 0; i < n_targets; i++) @@ -118,11 +112,7 @@ _gtk_quartz_target_entries_to_pasteboard_types (const GtkTargetEntry *targets, [set addObject:target_to_pasteboard_type (targets[i].target)]; } - ret = [set allObjects]; - - [set release]; - - return ret; + return set; } GdkAtom |