Revision: 6931
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6931&view=rev
Author:   hofman
Date:     2010-12-04 22:22:54 +0000 (Sat, 04 Dec 2010)

Log Message:
-----------
don't autorelease bookmarks when creating in bulk

Modified Paths:
--------------
    trunk/SKBookmark.m
    trunk/SKBookmarkController.m

Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m  2010-12-04 22:17:17 UTC (rev 6930)
+++ trunk/SKBookmark.m  2010-12-04 22:22:54 UTC (rev 6931)
@@ -354,8 +354,10 @@
     NSMutableArray *aChildren = [NSMutableArray array];
     SKBookmark *child;
     for (NSDictionary *setup in aSetupDicts) {
-        if (child = [SKBookmark bookmarkWithSetup:setup label:@""])
+        if (child = [[SKBookmark alloc] initWithSetup:setup label:@""]) {
             [aChildren addObject:child];
+            [child release];
+        }
     }
     return [[SKSessionBookmark alloc] initFolderWithChildren:aChildren 
label:aLabel];
 }
@@ -373,9 +375,10 @@
         NSMutableArray *newChildren = [NSMutableArray array];
         SKBookmark *child;
         for (NSDictionary *dict in [dictionary objectForKey:CHILDREN_KEY]) {
-            if (child = [SKBookmark bookmarkWithProperties:dict])
+            if (child = [[SKBookmark alloc] initWithProperties:dict]) {
                 [newChildren addObject:child];
-            else
+                [child release];
+            } else
                 NSLog(@"Failed to read child bookmark: %@", dict);
         }
         return [[bookmarkClass alloc] initFolderWithChildren:newChildren 
label:[dictionary objectForKey:LABEL_KEY]];

Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m        2010-12-04 22:17:17 UTC (rev 6930)
+++ trunk/SKBookmarkController.m        2010-12-04 22:22:54 UTC (rev 6931)
@@ -130,10 +130,11 @@
             } else if ([plist isKindOfClass:[NSDictionary class]]) {
                 [recentDocuments addObjectsFromArray:[plist 
objectForKey:RECENTDOCUMENTS_KEY]];
                 for (NSDictionary *dict in [plist objectForKey:BOOKMARKS_KEY]) 
{
-                    SKBookmark *bookmark = [SKBookmark 
bookmarkWithProperties:dict];
-                    if (bookmark)
+                    SKBookmark *bookmark = [[SKBookmark alloc] 
initWithProperties:dict];
+                    if (bookmark) {
                         [bookmarks addObject:bookmark];
-                    else
+                        [bookmark release];
+                    } else
                         NSLog(@"Failed to read bookmark: %@", dict);
                 }
             }
@@ -244,14 +245,16 @@
             Class docClass;
             SKBookmark *bookmark;
             if ([fileType isEqualToString:SKFolderDocumentType]) {
-                if (bookmark = [SKBookmark bookmarkFolderWithLabel:[fm 
displayNameAtPath:path]]) {
+                if (bookmark = [[SKBookmark alloc] initFolderWithLabel:[fm 
displayNameAtPath:path]]) {
                     [self addBookmarksForPaths:[fm 
contentsOfDirectoryAtPath:path error:NULL] basePath:path toFolder:bookmark 
atIndex:0];
                     if ([bookmark countOfChildren])
                         [folder insertObject:bookmark 
inChildrenAtIndex:insertIndex++];
+                    [bookmark release];
                 }
             } else if (docClass = [dc documentClassForType:fileType]) {
-                if (bookmark = [SKBookmark bookmarkWithPath:path 
pageIndex:([docClass isPDFDocument] ? 0 : NSNotFound) label:[fm 
displayNameAtPath:path]]) {
+                if (bookmark = [[SKBookmark alloc] initWithPath:path 
pageIndex:([docClass isPDFDocument] ? 0 : NSNotFound) label:[fm 
displayNameAtPath:path]]) {
                     [folder insertObject:bookmark 
inChildrenAtIndex:insertIndex++];
+                    [bookmark release];
                 }
             }
         }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to