I guess that's me...
schedule_really_free_object() gets called when the object reference count reaches zero. If the object hasn't been destructed, it gets added to the objects_to_destruct queue. Otherwise the object is freed. An object can thus arrive at schedule_really_free_object() twice; once before destruct() and once after. If an object arrives at schedule_really_free_object() more times than that, it's a strong hint that there's a missing add_ref() somewhere.
OK, that all makes sense to me, but if I've missed an add_ref() in my code, shouldn't that cause the object to be freed or destructed prematurely? I added an add_ref(o) to my code to prevent this problem, but the result was that the objects weren't getting freed. I've stepped through a simple program that exhibits the problem, and that object comes to schedule_really_free_object() numerous times, each time with a refcount of 0 or -1. I've noticed that once it finally enters its endless loop, o->next == o... shouldn't that cause the loop to stop?
Bill