I'm confused about a memory leak the new POSE 3.4 is reporting and I'm 
hoping someone can enlighten me.

I have two methods used to save a screen rectangle and restore 
it.  Something like this:

static WinHandle offscreen = 0;

void Save(void)
{
     offscreen = WinCreateOffscreenWindow(...);
     WinCopyRectangle(...);   // copy to offscreen
}


void Restore(void)
{
     WinCopyRectangle(...);   // copy from offscreen
     WinDeleteWindow(offscreen, false);
}

I am convinced that these are always called in pairs.  I have put 
breakpoints in both of them and verified this but periodically Poser 3.4 
reports 2 memory leaks which turn out to be the offscreen window created 
and the bitmap copied into it.  These leaks are reported while my app is 
still active.

What I don't understand is:

1) Why does Poser consider this a leak if I've deleted the window which 
should also clean up the bitmap?

2) How can Poser tell this is a leak if the app hasn't ended?  i.e. How 
does it know this is a leak as opposed to memory that I'm not finished using?

Any direction would be appreciated.

Regards,
Bob


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to