Forums > Dev

object_register(), reference count and object_free()

Mar 25 2014 | 8:37 am


I’d like to copy the buffer~ behaviour for my object and basically it works fine. Just a tiny little problem:

I register my object with a given name, when I create another object with the same name, on object_register(), instead of creating a new object, the free() functions is called and I only get a reference to the original object, so far so good.

I’m able to create as many references as I want. When I delete an object box in the patcher, everything is still fine, but when I delete the last instance in the patcher, I get only notified with the message "willfree", but the free function never gets called.

Is this behaviour intentionally? Do I miss something here?


Mar 25 2014 | 8:47 am

I forgot to mention:

If I create only one instance, it works fine, I get notified with "willfree" and then the free() function is called..

Jul 21 2014 | 10:53 am

If you are interested in providing some example code (and step-by-step instructions for reproducing) I’d be happy to take a look at it.

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

Forums > Dev