05-23-2024, 01:48 AM
You have to make certain that you aren't trying to free a resource that's still in use somewhere.
For example:
tempscreen = _newimage(600,400,32)
_DEST _tempscreen
_FONT foo
...stuff
_DEST _differentscreen
_FREEFONT foo
That above would still cause issues as foo is the active font for tempscreen, even though tempscreen has now moved into a background position and isn't active. What you'd need to do first is:
_DEST _tempscreen
_FONT 16 'swap to the default font
_FREEFONT foo
Remove that font from active duty on all screens, and then you shouldn't have any issues with freeing it for good from your program.
For example:
tempscreen = _newimage(600,400,32)
_DEST _tempscreen
_FONT foo
...stuff
_DEST _differentscreen
_FREEFONT foo
That above would still cause issues as foo is the active font for tempscreen, even though tempscreen has now moved into a background position and isn't active. What you'd need to do first is:
_DEST _tempscreen
_FONT 16 'swap to the default font
_FREEFONT foo
Remove that font from active duty on all screens, and then you shouldn't have any issues with freeing it for good from your program.