Re: NSObject performSelectorOnMainThread:
Re: NSObject performSelectorOnMainThread:
- Subject: Re: NSObject performSelectorOnMainThread:
- From: spike <email@hidden>
- Date: Fri, 14 Mar 2003 15:55:35 -0500
well, I had not even used the NSNumber in my method. I just had a NSLog
line that output "Update GUI!" to let me know that the method was
firing.
apparently I'm absolutely horrible with memory management, so I'm
rewriting my app with the help of a nice list of memory management
rules to guide me. If I have problems with this method when I'm done,
I'll play with it more.
...spike
On Friday, March 14, 2003, at 03:43 pm, Thomas Lachand-Robert wrote:
Le jeudi, 13 mars 2003, ` 17:51 Europe/Paris, spike a icrit :
[self performSelectorOnMainThread: @selector(updateMainGUI:)
withObject: [NSNumber numberWithBool: YES] waitUntilDone: NO];
EVERY time I call performSelectorOnMainThread, I get a signal 11
SIGSEGV.
Maybe it is not the true cause of the crash, but it seems unsafe to me
to use [NSNumber numberWithBool:YES] in a call to
performSelectorOnMainThread. Indeed as the selector will be executed
on the main thread, it is very possible that the autoreleased NSNumber
has already been deallocated in the working thread, hence the crash.
Did you try to retain the NSNumber long enough?
Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
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.