This is totally my fault but I decided to write a post in here just in case somebody comes across this in the future.
I needed a small app that loads in a bunch of pictures (like..thousands of them) and does some very basic editing (such as rescaling, adding text, stuff like that). Decided to use SFML since I've used it a lot in the past.
Guess I got used to the Garbage Collection of .NET and didn't even think about this until my PC froze.
BEWARE! GarbageCollection does NOT work automatically on Textures (and I assume other stuff as well) unless you call the Dispose method. It doesn't seem to matter that you're technically no longer using the texture and you no longer have any reference to it.
// Will cause a memmory leakpublic void DoStuff
(string[] texturePaths
) { foreach(var texturePath
in texturePaths
) { var texture
= new Texture
(texturePath
); DoOtherStuff
(texture
); }}// memmory gets cleared on GC.Collect()public void DoStuffSafely
(string[] texturePaths
) { foreach(var texturePath
in texturePaths
) { var texture
= new Texture
(texturePath
); DoOtherStuff
(texture
); texture
.Dispose(); // this. do this when you no longer need the texture }}