Commit a0ec0a36 authored by Colin Delacroix's avatar Colin Delacroix Committed by Felix Paul Kühne

Fix a crash on Mac OS X when mounting volumes

parent 578e883d
...@@ -775,8 +775,12 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -775,8 +775,12 @@ static VLCOpen *_o_sharedMainInstance = nil;
returnValue = kVLCMediaBDMVFolder; returnValue = kVLCMediaBDMVFolder;
else else
{ {
// NSFileManager is not thread-safe, don't use defaultManager outside of the main thread
NSFileManager * fm = [[NSFileManager alloc] init];
NSArray * topLevelItems; NSArray * topLevelItems;
topLevelItems = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath: mountPath error: NULL]; topLevelItems = [fm subpathsOfDirectoryAtPath: mountPath error: NULL];
[fm release];
NSUInteger itemCount = [topLevelItems count]; NSUInteger itemCount = [topLevelItems count];
for (int i = 0; i < itemCount; i++) { for (int i = 0; i < itemCount; i++) {
if([[topLevelItems objectAtIndex:i] rangeOfString:@"SVCD"].location != NSNotFound) { if([[topLevelItems objectAtIndex:i] rangeOfString:@"SVCD"].location != NSNotFound) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment