Problem with Release

BlitzMax Forums/BlitzMax Beginners Area/Problem with Release

I would assume that FlushMem will only delete the object when the reference count to that object is zero.

Maybe you could consider changing your code so that you do not have other objects pointing to this object?

[edit] one possible way to do what you want would be to have a global variable e.g.

gObjectDelete%=the handle of the object you are deleting

In your update functions for the other objects, check this global variable and if any of the other objects are pointing to it then make them release and null their pointers to it.

Once you have iterated through all the other objects then null the object itself and then call FlushMem.