Skip navigation.
 
mlRe: How can an object know when another object has gone away?
FROM : James Walker
DATE : Mon Jun 16 23:17:00 2008

Hamish Allan wrote:
> On Mon, Jun 16, 2008 at 1:39 AM, James W. Walker <<email_removed>> wrote:
>

>> No, the controller does not keep a reference to the task.  Why would it need
>> to do that in order to "keep it alive"?

>
> Because that's how memory management works. *Something* needs to keep
> a reference to your NSTask, otherwise your program is leaking memory
> (unless you're using garbage collection, in which case your task will
> simply disappear at some indeterminate point).


I mentioned in my original post that I'm using a wrapper around NSTask.
  The wrapper has a reference to the NSTask, and the wrapper manages
itself.  As I mentioned in a previous reply to you, I did take care to
release things at the appropriate times, so there is no leak.

Jens Alfke opined that it can be confusing for an object to manage its
own lifespan, but I do not find it so.  And I'm not planning on using
garbage collection, at least in my current project.
--
  James W. Walker, Innoventive Software LLC
  <http://www.frameforge3d.com/>

Related mailsAuthorDate
mlHow can an object know when another object has gone away? James W. Walker Jun 16, 00:20
mlRe: How can an object know when another object has gone away? Andreas Monitzer Jun 16, 00:25
mlRe: How can an object know when another object has gone away? James W. Walker Jun 16, 00:53
mlRe: How can an object know when another object has gone away? Hamish Allan Jun 16, 01:04
mlRe: How can an object know when another object has gone away? James W. Walker Jun 16, 02:39
mlRe: How can an object know when another object has gone away? Jens Alfke Jun 16, 20:23
mlRe: How can an object know when another object has gone away? Hamish Allan Jun 16, 21:52
mlRe: How can an object know when another object has gone away? Christopher Nebel Jun 16, 23:14
mlRe: How can an object know when another object has gone away? James Walker Jun 16, 23:17