Hi,
I would like to know a bit more about memory management, and specifically concerning textures.
I’ve been looking around for some stuff to read online but couldn’t quite find what I was looking for.
Maybe you guys have a good resource/link for me?
Something like this code for example:
public void setPuzzleImage() {
if (puzzleImage != null){
puzzleImage.dispose();
}
puzzleImage = new Texture(paintingsHashMap.get(SELECTEDPAINTING).getFilepath_painting());
}
From my puzzlegame…Whenever I start a new puzzle I check if puzzleImage is already pointing to a Texture object, and if so, disposes that Texture before creating a new object.
I have no idea if this is even usefull at all… If the memory that the previous texture-object held is already automatically freed up when it’s pointer/variable (puzzleImage) is pointing to a new object or not, etc.
Any suggestion ?