summaryrefslogtreecommitdiff
path: root/tikzit/src/common/PickSupport.m
diff options
context:
space:
mode:
authorJohan Paulsson <gonz@badcode.net>2015-02-25 12:36:17 -0800
committerJohan Paulsson <gonz@badcode.net>2015-02-25 12:36:17 -0800
commitffa99ec96899716ce1084177810303d336f51ff6 (patch)
treef427df60958a456351c73fddd7536bcfa81bc480 /tikzit/src/common/PickSupport.m
parent8233df2ddd3133618be536c5423cdc6a40b4a20c (diff)
Conversion of common files to ifdef for ARC
Diffstat (limited to 'tikzit/src/common/PickSupport.m')
-rw-r--r--tikzit/src/common/PickSupport.m19
1 files changed, 16 insertions, 3 deletions
diff --git a/tikzit/src/common/PickSupport.m b/tikzit/src/common/PickSupport.m
index 6470214..560fc2c 100644
--- a/tikzit/src/common/PickSupport.m
+++ b/tikzit/src/common/PickSupport.m
@@ -42,15 +42,24 @@
self = [super init];
if (self) {
- selectedNodes = [[NSMutableSet set] retain];
- selectedEdges = [[NSMutableSet set] retain];
+#if __has_feature(objc_arc)
+ selectedNodes = [NSMutableSet set];
+ selectedEdges = [NSMutableSet set];
+#else
+ selectedNodes = [[NSMutableSet set] retain];
+ selectedEdges = [[NSMutableSet set] retain];
+#endif
}
return self;
}
+ (PickSupport*)pickSupport {
- return [[[PickSupport alloc] init] autorelease];
+#if __has_feature(objc_arc)
+ return [[PickSupport alloc] init];
+#else
+ return [[[PickSupport alloc] init] autorelease];
+#endif
}
@synthesize selectedNodes;
@@ -176,7 +185,9 @@
}
if (replace) {
+#if ! __has_feature(objc_arc)
[selectedNodes release];
+#endif
selectedNodes = [nodes mutableCopy];
} else {
[selectedNodes unionSet:nodes];
@@ -208,10 +219,12 @@
}
- (void)dealloc {
+#if ! __has_feature(objc_arc)
[selectedNodes release];
[selectedEdges release];
[super dealloc];
+#endif
}
@end