vlc/vlc-2.0 | branch: master | Colin Delacroix <[email protected]> | Tue Mar 27 12:31:32 2012 +0200| [a0ec0a367cebf5569ca70dad322ead58c4c7ed9d] | committer: Felix Paul Kühne
Fix a crash on Mac OS X when mounting volumes > http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=a0ec0a367cebf5569ca70dad322ead58c4c7ed9d --- modules/gui/macosx/open.m | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m index 2381a2d..5bb14d5 100644 --- a/modules/gui/macosx/open.m +++ b/modules/gui/macosx/open.m @@ -775,8 +775,12 @@ static VLCOpen *_o_sharedMainInstance = nil; returnValue = kVLCMediaBDMVFolder; else { + // NSFileManager is not thread-safe, don't use defaultManager outside of the main thread + NSFileManager * fm = [[NSFileManager alloc] init]; NSArray * topLevelItems; - topLevelItems = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath: mountPath error: NULL]; + topLevelItems = [fm subpathsOfDirectoryAtPath: mountPath error: NULL]; + [fm release]; + NSUInteger itemCount = [topLevelItems count]; for (int i = 0; i < itemCount; i++) { if([[topLevelItems objectAtIndex:i] rangeOfString:@"SVCD"].location != NSNotFound) { _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
