Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Committed changes to Foundation code.

  • Loading branch information...
commit 792c3d762b583fd1a1763cf81fcb011e09fa90c7 1 parent 2a20d7d
authored March 15, 2011

Showing 1 changed file with 9 additions and 7 deletions. Show diff stats Hide diff stats

  1. 16  SMLBasicPerformer.m
16  SMLBasicPerformer.m
@@ -116,10 +116,11 @@ - (NSString *)createUUID
116 116
 {
117 117
     CFUUIDRef uuid = CFUUIDCreate(NULL);
118 118
     CFStringRef uuidString = CFUUIDCreateString(NULL, uuid);
119  
-    NSMakeCollectable(uuid);
  119
+    CFRelease(uuid);
  120
+    
  121
+    // Again, not happy with this in non-gc environments.
120 122
 	NSMakeCollectable(uuidString);
121  
-
122  
-    return (NSString *)uuidString;
  123
+    return [(NSString *)uuidString autorelease];
123 124
 }
124 125
 
125 126
 /*
@@ -157,7 +158,6 @@ - (NSString *)resolveAliasInPath:(NSString *)path
157 158
 {
158 159
 	NSString *resolvedPath = nil;
159 160
 	CFURLRef url = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)path, kCFURLPOSIXPathStyle, NO);
160  
-	NSMakeCollectable(url);
161 161
 	
162 162
 	if (url != NULL) {
163 163
 		FSRef fsRef;
@@ -165,20 +165,22 @@ - (NSString *)resolveAliasInPath:(NSString *)path
165 165
 			Boolean targetIsFolder, wasAliased;
166 166
 			if (FSResolveAliasFile (&fsRef, true, &targetIsFolder, &wasAliased) == noErr && wasAliased) {
167 167
 				CFURLRef resolvedURL = CFURLCreateFromFSRef(NULL, &fsRef);
168  
-				NSMakeCollectable(resolvedURL);
169 168
 				if (resolvedURL != NULL) {
170 169
 					resolvedPath = (NSString*)CFURLCopyFileSystemPath(resolvedURL, kCFURLPOSIXPathStyle);
171  
-					NSMakeCollectable(resolvedPath);
  170
+                    CFRelease(resolvedURL);
172 171
 				}
173 172
 			}
174 173
 		}
  174
+        CFRelease(url);
175 175
 	}
176 176
 	
177 177
 	if (resolvedPath==nil) {
178 178
 		return path;
179 179
 	}
180 180
 	
181  
-	return resolvedPath;
  181
+    // Not sure I'm happy with this line in a non-gc environment.
  182
+    NSMakeCollectable(resolvedPath);
  183
+	return [resolvedPath autorelease];
182 184
 }
183 185
 
184 186
 @end

0 notes on commit 792c3d7

Please sign in to comment.
Something went wrong with that request. Please try again.