Just checking

BlitzMax Forums/BlitzMax Beginners Area/Just checking

(tu) ENAY(Posted 2005) [#1]
In Blitzmax doing something like this:-

image = loadimage("arse.png")
image = null
flushmem()
image = loadimage("baps.png")


is exactly the same way you do it in other blitz languages like this:-

image = loadimage("arse.png")
Freeimage image
image = loadimage("baps.png")


Just hoping this is actually working right. :)


Mark Tiffany(Posted 2005) [#2]
You can actually do:
image = loadimage("arse.png")
image = loadimage("baps.png")

and get the same result (with 1.12 onwards). As soon as nothing references the image, it can be picked up by autoflushmem. Although possibly only if you declare image "properly" as image:TImage.


Grey Alien(Posted 2005) [#3]
you ought to to
image:TImage = loadimage("frontbottom.bmp")



Hotcakes(Posted 2005) [#4]
And Flushmem is no longer in existance.


Yan(Posted 2005) [#5]
Just to make things crystal...
Local image:TImage = loadimage("baps.bmp")
image = loadimage("kebab.bmp")
If you really have to...

Local image = loadimage("baps.bmp")
Release image
image = loadimage("kebab.bmp")



Grey Alien(Posted 2005) [#6]
to be honest I'm more confortable with manual collect (but leaving auto on) so you can free at the best times for your app and have MAx collect anything you miss (because you WILL miss something!). That's why things like Delphi and C++ have special apps you run alongside that spot memory leaks and tell you where to fix the code, they're cool.


(tu) ENAY(Posted 2005) [#7]
Yeah I just noticed Flushmem has vanished.