[futurebasic] dipsosing icons

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

From: Waverly Edwards <Waverly@...>
Date: Tue, 23 Dec 1997 18:19:37 +0000
FYI,

This is so none of you go through then pain I went through.  When disposing
of cicns/icons use (if you value your sanity) DISPOSCICON/DISPOSICON.  I
Spent hours trying fix a memory leak.  

In one of my functions I called GETRESOURCE(_"cicn", iconID%) and got a
handle to the cicn.  After plotting the icon and chose to dispose it.  The
way I handled this (no pun intended) was to detatch the handle then dispose
of it using FN DISPOSEH.  Only part of the allocated memory was disposed.
When using FN DISPOSEH didnt work (so I thought) I tried various toolbox
calls.  None of these toolbox calls worked.  I set memory conditions
abnormally low to see if the OS would purge them.  I ran out of memory and
those handles were NEVER purged.

I got kinda heated up and thought I'd call an expert.  I called David, you
know that Techie at STAZ software.  About 10 seconds after I explained to
him what the problem was he informed me that I need to use DISPOSICON or one
of its siblings to dispose of my handle.  He was absolutely right.
Apparently an *unpurgeable* chunk of memory is left behind if you dont use
DISPOSICON.  He also explained to me about disposing of picture handles.
Apparently there is something behind the scenes regaring pictures and icons
that Apple doesnt document.  They tell us to use the specific toolbox calls
to release these handles.

Dont go through the torture I went through, heed my warning and Davids
advice.  Use the toolbox calls Apple says to use.


W.

................................................................................

"If the only tool you have is a hammer, then every solution looks like a nail."
	Abraham Maslow

The only time you should look down on a man is when you're helping him get up.

................................................................................