[futurebasic] Re: Clipboard/Memory??

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: David Blache <microcsm@...>
Date: Thu, 11 Dec 97 12:29:08 -0600
Rick Brown wrote:

>> If the picture was created "on the fly" using the Picture On / Picture 
>> Off calls, then you should use the KillPicture toolbox call, or even 
>> better, just set the handle's state to purgeable with the HSetState call 
>> and be on your merry way.
>
>I hadn't heard this before.  What exactly does KillPicture do that
>DisposeHandle doesn't?

I can't tell you that, as it is undocumented by Apple.  But you _will_ 
lose memory if you use DisposeHandle rather than KillPicture.

Try it (if you are like me and have to see it for yourself)...do a loop 
of say 10000 iterations where you create a picture and dispose of it.  If 
you use DisposeHandle, you will lose memory.  If you use KillPicture you 
won't.

It's just a few hundred bytes at worst, but it is still a memory loss.  I 
_believe_ that it is probably a CLUT or some other structure linked to 
the picture.  But since Apple doesn't document it I can't be sure.  
Bottom line, use KillPicture exclusively (with the exception of res-based 
pics) and you won't lose memory.

========================================
|       David Blache - Developer       |
========================================
|   Staz Software, Inc - Stazologist   |
|        (tech@...)       |
|   Microcosm Software, Inc. - Owner   |
|        (microcsm@...)        |
========================================