summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@openwide.fr>2015-10-15 10:41:38 +0200
committerChris Michael <cp.michael@samsung.com>2015-12-03 11:31:05 -0500
commitae305761e05398e3c233d9c42efb36e44cd2c6b5 (patch)
tree58b49115f0fe55528dcc40cf13ff4c87cb49ce6f
parentba73c40fdb2aef214b1c1631dcb2301f73555cbb (diff)
downloadefl-ae305761e05398e3c233d9c42efb36e44cd2c6b5.tar.gz
ecore_cocoa_cnp: make API thread-safe
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_cnp.m11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
index 605bfa9299..efe3cbdbef 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_cnp.m
@@ -14,13 +14,11 @@ ecore_cocoa_selection_clipboard_set(const void *data,
int size,
Ecore_Cocoa_Cnp_Type type)
{
- static NSMutableArray *objects = nil;
+ NSMutableArray *objects;
NSString *str = nil;
BOOL ok = YES;
- if (!objects)
- objects = [[NSMutableArray alloc] init];
-
+ objects = [[NSMutableArray alloc] init];
if (type & ECORE_COCOA_CNP_TYPE_STRING)
{
str = [[NSString alloc] initWithBytes: data
@@ -68,7 +66,7 @@ ecore_cocoa_selection_clipboard_get(int *size,
Ecore_Cocoa_Cnp_Type type,
Ecore_Cocoa_Cnp_Type *retrieved_types)
{
- static NSMutableArray *classes = nil;
+ NSMutableArray *classes;
void *data;
NSDictionary *options;
NSPasteboard *pb;
@@ -77,8 +75,7 @@ ecore_cocoa_selection_clipboard_get(int *size,
BOOL string_class = NO;
Ecore_Cocoa_Cnp_Type types = 0;
- if (!classes)
- classes = [[NSMutableArray alloc] init];
+ classes = [[NSMutableArray alloc] init];
if ((type & ECORE_COCOA_CNP_TYPE_STRING) ||
(type & ECORE_COCOA_CNP_TYPE_MARKUP))