Do I need to clear listbox RowTags Before Deleting Rows?

If I have RowTags holding an object and then call listbox.DeleteAllRows, will my RowTag reference to that object be cleared for me?

That is, if I fail to clear my rowtags first, will I be interfering with garbage collection?

I assume deleting a row removes its rowtag reference.

there is no garbage collection - its reference counting so when the last reference is gone the item is cleaned up right away

when you delete a row the rowtag is also removed and if that was a reference to an object that reference is removed as well

no need to manually remove rowtags

Thanks Norman. I always mistakenly call reference counting garbage collection because it’s the same magic in the back of my head :wink:

Ah no
If you’ve ever had the joy of dealing with Java’s garbage collection you’d never get it wrong

What I like about reference counting is that destruction of an object is VERY deterministic.
Last reference is gone the object is cleaned up right then.
Not so with Java’s garbage collection. There’s no “destructor” but a “finalizer”
The runtime periodically runs a thread to find all objects that cannot be referenced from your app and finalizes them at that point. It’s like your destructor runs “some time later” - not when the last reference is gone.
That can lead to some interesting issues.

There are ways to force that thread to run ASAP but you really shouldn’t have to.

/me counts his lucky stars in many ways that he’s using Xojo and not Java