aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_cocoa/ecore_cocoa_cnp.m')
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_cnp.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
index f94dfe98cd..605bfa9299 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
@@ -15,16 +15,12 @@ ecore_cocoa_selection_clipboard_set(const void *data,
Ecore_Cocoa_Cnp_Type type)
{
static NSMutableArray *objects = nil;
- NSPasteboard *pb;
NSString *str = nil;
BOOL ok = YES;
if (!objects)
objects = [[NSMutableArray alloc] init];
- pb = [NSPasteboard generalPasteboard];
- [pb clearContents];
-
if (type & ECORE_COCOA_CNP_TYPE_STRING)
{
str = [[NSString alloc] initWithBytes: data
@@ -55,6 +51,10 @@ ecore_cocoa_selection_clipboard_set(const void *data,
/* Write to pasteboard */
if ([objects count] > 0)
{
+ NSPasteboard *pb;
+
+ pb = [NSPasteboard generalPasteboard];
+ [pb clearContents];
ok = [pb writeObjects: objects];
[objects removeAllObjects];
}