DrawPixmap Memory leak
BlitzMax Forums/BlitzMax Programming/DrawPixmap Memory leak
The use of DrawPixmap(or any other Functions) don't free it used temporary Memory !?
Strict
Graphics 800,600,0
Cls
SetColor 255,0,0
DrawOval 0,0,256,256
Local testpixmap = GrabPixmap(0,0,256,256)
Repeat
Cls
DrawPixmap testpixmap,100,100
DrawText "Mem Alloced: "+MemAlloced(), 10,10
Flip
'FlushMem()
Until KeyHit(KEY_ESCAPE)
Maybe you should un-comment Flushmem?
the idee of FlushMem is another one i think ...
This is OK !
img=Create(x,y)
MainLoop
Draw img
End MainLoop
img=NULL
FlushMem
Ok, Suco tells me that everything don't free it used memory .
Translated Text:
I find it to very atypical.
eh???
You need FlushMem inside your main loop.
Hello,
Help:
Causes the BlitzMax garbage collector to remove all unreferenced objects from memory.
from where am I to know that BlitzMax functions
remove the reference from internal used objects?
I have see it that my harddisc led flashed up
on running my program and after a long time
the program halts because no virtual memory are there .
Hi Markus,
What is the *exact* code you're using because it is hard to understand what you are doing?
No leak here - with Flushmem uncommented of course...
@Mark
Yes, sorry but i can't edit the title of the thread .
In different laguages there are no FlushMem Function .
Nice to have if you can split the garbage collector from
BlitzMax Functions(intern) and the own program .
Example what i mean
1. DrawText Allocate Memory,Free Memory
2. DrawText Allocate Memory,Free Memory
and no FlushMem i must use
is the same as
1. DrawText Allocate Memory
2. DrawText Allocate Memory
3. FlushMem
-------------
img=Create(x,y) Allocate Memory
MainLoop
Draw img Allocate Memory,Free Memory
End MainLoop
img=NULL
FlushMem Free my own used Memory