On Sun, 1 Aug 1999, Chris Antos wrote:
> look for a place where you are missing a MemPtrFree call.
> also, try comparing the heap size before you allocate, and after you think
> you've released the memory.
this is my code:
---
programData = MemPtrNew(imageSize);
....
MemPtrFree(programData);
---
there is NOWAY it misses the MemPtrFree call.. if it does, then the
program has crashed (before it).. and it does not do this.
> here are a couple macros i use to perform heap checking on a given scope.
> if you're using C++, they're a great candidate for getting rolled into a
> class that automatically checks the heap. you'll need to replace the DbgMsg
> function call with something of your own that accomplishes the same thing.
ok.. i will check these out
i did this:
---
DWord startFreeDynamicMemory, endFreeDynamicMemory, junk;
MemHeapFreeBytes(0, &startFreeDynamicMemory, &junk);
{
DmSearchStateType stateInfo;
DmGetNextDatabaseByTypeCreator(
TRUE, &stateInfo, sysFileTApplication,
creatorID, FALSE, &cardNo, &dbID
);
}
// launch the program!
launchCode = sysAppLaunchFlagNewStack|sysAppLaunchFlagNewGlobals;
SysAppLaunch(cardNo,dbID,launchCode,cmd,cmdPBP,&err);
MemHeapFreeBytes(0, &endFreeDynamicMemory, &junk);
ErrFatalDisplayIf((endFreeDynamicMemory != startFreeDynamicMemory),"HEAP loss");
---
and.. regardless of what application i load (i even tried puzzle.prc -
which comes with the SDK).. i get heap loss error..
strange? :>
az.
--
Aaron Ardiri
Lecturer http://www.hig.se/~ardiri/
University-College i G�vle mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN
Tel: +46 26 64 87 38 Fax: +46 26 64 87 88
Mob: +46 70 352 8192 A/H: +46 26 10 16 11