Skip to content

Commit 4c8486b

Browse files
committed
Still needs work but pretty good.
1 parent b94f56a commit 4c8486b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

SSYCarbonSearcher.m

+8-3
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ + (BOOL)catalogPathsForName:(NSString*)searchString
276276
asyncCallbackTarget:(id)asyncCallbackTarget
277277
asyncCallbackSelector:(SEL)asyncCallbackSelector
278278
err_p:(OSErr*)err_p {
279-
// Determine which mode to run
279+
// Determine which mode to run
280280
BOOL runAsync = (asyncCallbackTarget || asyncCallbackSelector) ;
281281

282282
const char* searchCString = [searchString UTF8String] ;
@@ -344,6 +344,8 @@ + (BOOL)catalogPathsForName:(NSString*)searchString
344344
goto end ;
345345
}
346346
else {
347+
// There is a leak somewhere in this branch, when runAsync = YES.
348+
347349
// This is the first of many allocations we will make.
348350
// Any variable accessed by PBCatalogSearchAsync() or SearchCompletionProc()
349351
// must be allocated because otherwise they will go away when this method exits
@@ -464,9 +466,12 @@ + (BOOL)catalogPathsForName:(NSString*)searchString
464466
if (!runAsync) {
465467
summary = ExtractResults(searchInfo_p) ;
466468
DisposeAndRelease(searchInfo_p) ;
467-
}
468-
}
469+
}
470+
}
469471

472+
// Memory leak fixed in BookMacster 1.16.5…
473+
FSCloseIterator(iterator) ;
474+
470475
end:
471476
if (syncResults_p != NULL) {
472477
*syncResults_p = summary ;

SSYPersistentDocumentMultiMigrator.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ + (BOOL)migrateIfNeededStoreAtUrl:(NSURL*)url
252252
}
253253

254254
#if 0
255-
// Fix 20130610
255+
// Fix 20130610 - Does not work.
256256
BOOL isWritable = [[NSFileManager defaultManager] isWritableFileAtPath:[url absoluteString]] ;
257257
BOOL isInViewingMode = [document isInViewingMode] ;
258258
/*SSYDBL*/ NSLog(@"isWritable = %ld isInViewingMode = %ld ", isWritable, isInViewingMode) ;

0 commit comments

Comments
 (0)