Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
When to free an image?
#1
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?

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
Reply


Messages In This Thread
When to free an image? - by James D Jarvis - 04-13-2023, 02:54 PM
RE: When to free an image? - by TerryRitchie - 04-13-2023, 03:28 PM
RE: When to free an image? - by SMcNeill - 04-13-2023, 05:02 PM
RE: When to free an image? - by James D Jarvis - 04-13-2023, 05:45 PM
RE: When to free an image? - by mnrvovrfc - 04-13-2023, 06:26 PM
RE: When to free an image? - by OldMoses - 04-16-2023, 08:55 PM



Users browsing this thread: 2 Guest(s)