Revision
4469
Author
watson1978@gmail.com
Date
2010-08-26 16:33:33 -0700 (Thu, 26 Aug 2010)

Log Message

Fixed the Leak

Modified Paths

Diff

Modified: MacRuby/trunk/bs.c (4468 => 4469)


--- MacRuby/trunk/bs.c	2010-08-26 20:43:06 UTC (rev 4468)
+++ MacRuby/trunk/bs.c	2010-08-26 23:33:33 UTC (rev 4469)
@@ -454,6 +454,7 @@
   /* check if the given framework path has not been loaded already */
   cf_path = CFStringCreateWithFileSystemRepresentation(kCFAllocatorMalloc, 
     path);
+  CFMakeCollectable(cf_path);
   for (unsigned i = 0, count = CFArrayGetCount(parser->loaded_paths);
        i < count; i++) {
     CFStringRef s = CFArrayGetValueAtIndex(parser->loaded_paths, i);
@@ -1269,7 +1270,6 @@
 	  }
       }
   }
-  CFRelease(cf_path);
 
   if (success && options == BS_PARSE_OPTIONS_LOAD_DYLIBS && framework_path != NULL) {
     char buf[PATH_MAX];