11-03-2024, 02:49 AM
There's just one glaring problem with what bplus wrote, which might affect you, and that's if you're calling _LOADIMAGE inside a sub.
It won't matter if you add that style IF before that _LOADIMAGE statement, as temp is *always* going to be 0 and you're *always* going to be loading images without freeing them.
You need to _FREEIMAGE your stuff once it goes out of scope and isn't being used any more.
OR
You need to simply load your images ONCE when the program starts up and initializes, and then use and resuse those same image handles over and over inside your program where they're needed.
Without sharing the code, there's no way anyone can tell you where to place a _FREEIMAGE statement. Share what you have, and then we can help point out what might be the best solution for your problems, so you can fix them and move forward without your memory leaking.
Code: (Select All)
SUB Foo
temp = _LOADIMAGE("whatever.png",32)
... stuff
END SUB
It won't matter if you add that style IF before that _LOADIMAGE statement, as temp is *always* going to be 0 and you're *always* going to be loading images without freeing them.
You need to _FREEIMAGE your stuff once it goes out of scope and isn't being used any more.
OR
You need to simply load your images ONCE when the program starts up and initializes, and then use and resuse those same image handles over and over inside your program where they're needed.
Without sharing the code, there's no way anyone can tell you where to place a _FREEIMAGE statement. Share what you have, and then we can help point out what might be the best solution for your problems, so you can fix them and move forward without your memory leaking.