object_register(), reference count and object_free()

Thomas Resch's icon

Hi,

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?

Thomas

Thomas Resch's icon

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..

Timothy Place's icon

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.