[futurebasic] Re: [FB] AECreateAppleEvent memory leak

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 1999 : Group Archive : Group : All Groups

From: "David Blache" <alterego@...>
Date: Sat, 20 Mar 1999 20:14:47 -0600
> If I watch MEM(_freemem) carefully before and after each line (by using a
> little ALERT), all of the memory is not recovered on the second
> AEDISPOSEDESC call. 32 bytes are lost. From experience, it sounds like a
> handle or two was not disposed of properly, but  I can't figure where, even
> with the Apple "Creating and Sending AppleEvents" documentation and the
> nice series on Appleevents in Inside Basic.
> If I leave out creating and disposing of the appleevent, no memory is lost,
> so it has something to do with creating and disposing the appleevent. But
> all the errors are coming back _noErr. Can someone with some experience
> with appleevents help me out here? Thanks. CC me if you send a reply
> because I'm on digest.

You are referring to MEM(_freeBytes) I believe.  MEM(_freeBytes) doesn't
dispose of purgeable handles or compact the heap.  In that case, you don't
know whether this is a memory leak, or just handles that will be disposed of
automatically by the OS the next time an appropriate Memory Manager function
is called.

Before assuming it is a leak, you might want to verify that the Memory
Manager will not dispose of it automatically.  ;-)

| David Blache          Software Developer / Technical Writer |
| Microcosm Software    http://www.thesanctuary.com/microcosm |
| Metrowerks                        http://www.metrowerks.com |