Forums > Dev

object_retain and box objects

March 17, 2011 | 10:19 pm

Hi.

I am working at a family of objects composed by a server and several clients. I need the server object not to be freed until there is one client in existence, and I use reference counting for this.

I have made some tests in which I remove from the patcher an object whose reference count is > 1, and everything seems to work well: the box disappears, the patcher doesn’t go crazy and the object still continues to exist until all its references are released.

But I wish to be sure that retaining a box object has no bad side effects I didn’t notice. Of course I can think of an alternative with a nobox object being retained, and the box "server" just being an interface to it: but this would make the design of the whole system more complicated, and if it’s not necessary I’d rather not.

Thanks for your advice!
aa


March 21, 2011 | 10:46 pm

bang…


March 22, 2011 | 12:45 pm

Hi Vanille.
Actually, the sheep/shepherd example addresses a slightly different situation.
As you say, I "want the object to survive after been freed by user while retainer object still alive"…
thanks anyway!
aa


Viewing 3 posts - 1 through 3 (of 3 total)