04-13-2023, 02:54 PM
When is it a good idea to use _freeimage to clean up an image from memory?
The obvious answer is of course... when you are done with it.
But is it necessary at programs end to clean up the image handles if they were declared in the main program or only in subroutines?
The obvious answer is of course... when you are done with it.
But is it necessary at programs end to clean up the image handles if they were declared in the main program or only in subroutines?
Code: (Select All)
dim shared image1 as long
dim shared image2 as long
screen _newimage (640,400,32)
_fullscreen
image1= _LoadImage("Data\im_1.png")
_putimage (0,0)-(639,399),image1
LOADTWO
_putimage (0,0)-(339,3199),image2
'should either of these two lines be used (without being commented out)
'_freeimgae image1
'_freeimage image2
end
sub loadtwo
image1= _LoadImage("Data\im_2.png")
end sub