I am using NSOpenPanel to allow the user to choose a file from their MAC. The panel opens up fine and filters the correct files out but as soon as I click on a file, my application crashes.
Here is my code to open the panel:
if ([openDlg runModalForDirectory:begin file:filename types:filetypes] == NSOKButton)
{
NSArray* selected = [openDlg filenames];
for (int i = 0; i < (int)[selected count]; i++)
{
NSString* fileName = [selected objectAtIndex:i];
string fn = [fileName UTF8String];
results->Append(Value::NewString(fn));
}
}
The code never returns from the runmodalForDirectory method call.
So once I select a file the Debugger Console says this:
Program received signal: “EXC_BAD_ACCESS”.
warning: Unable to restore previously selected frame.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.)
Briefly I see not safe to call dlOpen at this time.
and then I get this:
and the call stack looks like this:
Call stack before recursive call happens:
The call stack is in the WebKit framework file called WebFullScreenController.mm recursively calling this method setDisableActions:
@implementation CATransaction(SnowLeopardConvenienceFunctions)
+ (void)setDisableActions:(BOOL)flag
{
[self setValue:[NSNumber numberWithBool:flag] forKey:kCATransactionDisableActions];
}
Does anybody have any ideas of why this is happening? Thanks in advance.
I found the answer, we could probably delete this question, it turned out it was the version of webkit I was using, and I had to modify webkit per this bug fix posted on webkit.org