Original Post
So i tried looking everywhere for a solid answer for this but there is a lot of contradiction and since i have my own possibly wrong thoughts makes this very confusing.
This pretty much goes for any object i dont use anymore but let's take the enemy object. What should i do exactly if health drops below 0?
Obviously i can put it out of my list, it does not get updated or drawn anymore, but is it still in memory?
Some say this is enough, i doubt this.
Some say i have to null it so the garbage collector takes it on its next run.
Some say i have to make it inherit IDisposable and dispose of it manually.
So what is a good way to handle objects that you wont be using anymore?
This pretty much goes for any object i dont use anymore but let's take the enemy object. What should i do exactly if health drops below 0?
Obviously i can put it out of my list, it does not get updated or drawn anymore, but is it still in memory?
Some say this is enough, i doubt this.
Some say i have to null it so the garbage collector takes it on its next run.
Some say i have to make it inherit IDisposable and dispose of it manually.
So what is a good way to handle objects that you wont be using anymore?