Hi, I'm creating a simulation in which a large number of objects are added to vectors and then taken away in random order (as more are being added).

To remove the objects, I splice the object from the vector it's in, and notify all the other objects that an object ahead of them was removed so they can change their indices accordingly.

As far as I know, the objects have no other references (I think), and within the object, I set everything to null. I read somewhere that you can't put "delete this" in the class, so I didn't bother with that.

Will this be sufficient to get the object garbage collected, or should I do something else? What are the best ways to get something like this garbage collected?

Thanks,
Mavrisa