PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

GapiDraw 201b Memory Leaks

Johan,

Have you ever used BoundsChecker on GapiDraw? I'm getting about 6K in nested memory leaks from HeapDestroy, and 4 bytes from DeleteCriticalSection (I think this is actually from the OS) when instrumenting the Minimal sample. This is from BoundsChecker 7 under VC6 on Win2K. It appears the leaks occur when SHLWAPI.DLL is unloaded, but I can't be sure of that.
Hi,

Can you test one thing:

Instead of creating surfaces with either (a) on stack, or (b) using "new", try:
CGapiSurface* m_pSurface = CGapiSurface_Create();

and also, instead of "delete", try:
CGapiSurface_Destroy(m_pSurface);

I don't like BoundsChecker simply because it doesn't work as it should. There is a known issue with BoundsChecker when classes are allocated from DLLs. Calling functions in the DLL for memory allocation /de-allocation does the trick. Please note though that you have to change CGapiApplication as well (you might want to try changing the MFC demo instead since it's easier to modify).

Post any results here if you have the time... The memory / resource allocation routines in GapiDraw are extremely tested and should have no memory leaks.
I'll give that a try and let you know. Thanks Johan