Opening a NSOpenPanel in a secondary thread -> crash
Opening a NSOpenPanel in a secondary thread -> crash
- Subject: Opening a NSOpenPanel in a secondary thread -> crash
- From: Andrea at Redmatica <email@hidden>
- Date: Wed, 19 Nov 2003 00:49:20 +0100
I just discovered that using for several times (4-5 times) an
NSOpenPanel from a secondary thread leads to a crash.
Example: if i detach the following thread from the main thread (i'm
using NSThreads, not pthreads),
- (void) SecThread
{
NSAutoreleasePool *lp=[[NSAutoreleasePool alloc] init];
NSOpenPanel *op=[NSOpenPanel openPanel];
while(TRUE)
{
[op runModalForTypes:nil];
}
.....
}
After 4-5 cycles,the main thread crashes with this kind of stack:
#0 0x90190d5c in CFRelease
#1 0x92f299d0 in toolTipTimerFired
#2 0x92f299d0 in toolTipTimerFired
#3 0x90194848 in __CFRunLoopDoTimer
#4 0x90191ba8 in __CFRunLoopRun
#5 0x901960bc in CFRunLoopRunSpecific
#6 0x927d5ecc in RunCurrentEventLoopInMode
#7 0x927dc640 in ReceiveNextEventCommon
#8 0x927fe6d0 in BlockUntilNextEventMatchingListInMode
#9 0x92dd2a80 in _DPSNextEvent
#10 0x92de93fc in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
#11 0x92dfd730 in -[NSApplication run]
#12 0x92eb9a1c in NSApplicationMain
Anyone has any idea of how to overcome the problem?
Is this a situation of thread unsafe AppKit?
Do i have to use distributed objects for this task?
I'm using 10.3.1 and xcode 1.0.1.
Thank you a lot.
Andrea
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.