DrawPixmap Memory leak

BlitzMax Forums/BlitzMax Programming/DrawPixmap Memory leak

Markus Rauch(Posted 2005) [#1]
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)


N(Posted 2005) [#2]
Maybe you should un-comment Flushmem?


Markus Rauch(Posted 2005) [#3]
the idee of FlushMem is another one i think ...

This is OK !

img=Create(x,y)
MainLoop
Draw img
End MainLoop
img=NULL
FlushMem


Markus Rauch(Posted 2005) [#4]
Ok, Suco tells me that everything don't free it used memory .

Translated Text:
I find it to very atypical.


Yan(Posted 2005) [#5]
eh???


BlitzSupport(Posted 2005) [#6]
You need FlushMem inside your main loop.


Markus Rauch(Posted 2005) [#7]
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 .


tonyg(Posted 2005) [#8]
Hi Markus,
What is the *exact* code you're using because it is hard to understand what you are doing?


marksibly(Posted 2005) [#9]
No leak here - with Flushmem uncommented of course...


Markus Rauch(Posted 2005) [#10]
@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