What happens when you don't release DTMs or bitmaps that were loaded? Isn't it stupid to load DTMs and release them over and over again, when you could just load them at startup and go on?
What happens when you don't release DTMs or bitmaps that were loaded? Isn't it stupid to load DTMs and release them over and over again, when you could just load them at startup and go on?
Miner & Urn Crafter & 07 Chicken Killer
SPS BlindWalk Tutorial
Working on: Nothing
teacher in every art, brought the fire that hath proved to mortals a means to mighty ends
I had a procedure to load all my DTMs before the mainloop. Then had a procedure that free them all too, and added it into this function.
Simba Code:AddOnTerminate('FreeAllDTMs');
So when the script terminates, it will free my dtms. And I don't need to load and free the dtm everytime in a procedure or function. Well, that's just what I do in my scripts, not sure about others.
Miner & Urn Crafter & 07 Chicken Killer
SPS BlindWalk Tutorial
Working on: Nothing
teacher in every art, brought the fire that hath proved to mortals a means to mighty ends
if you dont release them eventually it will crash( i learnt the hard way)
Even if you clog up your memory, a simple reboot will clear all that, no?
yes, even restarting the program would theoretically reset the memory cache for it. But while your script is running you will just be chewing away at memory. It will just cause crashing in the long run.
Simba actually release all bitmaps and DTMs automatically when script is terminated. But if you create more and more new bitmaps/dtms when script is running and don't free any you will flood your memory and you can end with error:
Error: Exception: Out of memory at line 22
Tuts: Run script from another script || [Lape] Exceeding limits of VariantInvoke()
Plugins: Fast multi-layer objects finding || Multithreading in tabs|| Optimised motion detection || ETL - paint on any window||Magic Keyboard (Simba's DirectX input + input in background to any normal window)
Snippets: [RS] Ultimate Loot Grabber || ShowPalette() || APPA JS Interface
the reason many people choose to release within each procedure is that if they have alot, eventually they wouldnt be able to load them all at the beginning and release at the end so they just release within each procedure/function in case they add more
There are currently 1 users browsing this thread. (0 members and 1 guests)