discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: releasing a thread object (Gworkspace)


From: Riccardo Mottola
Subject: Re: releasing a thread object (Gworkspace)
Date: Tue, 21 Oct 2014 12:18:40 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0 SeaMonkey/2.30

Hi,

Riccardo Mottola wrote:
"An |NSThread| object posts this notification when it receives the |exit <https://developer.apple.com/library/IOs/documentation/Cocoa/Reference/Foundation/Classes/NSThread_Class/index.html#//apple_ref/occ/clm/NSThread/exit>| message, before the thread exits. Observer methods invoked to receive this notification execute in the exiting thread, before it exits."

so, well, it exited! This confuses me: it exits and does not release, but i can't release it afterwards. A call to detachNewThreadSelector may involve oneway methods, thus asynchornous stuff, it is not that I can just put a release at the end (which end?)
actually, i correct myself: since it is "before exit":

This method uses the currentThread class method to access the current thread. Before exiting the thread, this method posts the NSThreadWillExitNotification with the thread being exited to the default notification center. Because notifications are delivered synchronously, all observers of NSThreadWillExitNotification are guaranteed to receive the notification before the thread exits.

I am guaranteed to get the notification before the end.

Right now, if I try to print out the executor with " NSLog(@"executor %@, ", executor);" when I get the notification I get:

2014-10-21 13:20:45.340 GWorkspace[27019] Problem posting notification: <NSException: 0x850cf230> NAME:NSObjectInaccessibleException REASON:Forwarding message for 0x850c9e50 in wrong thread - <GSFFIInvocation 0x7f3d6610 selector: methodSignatureForSelector: target: NSDistantObject> INFO:(null)

I suppose this means the remote object is already dead or somehow dealloc'ed, even if i didn't see a dealloc.

Riccardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]