I am writing a program in C,which is in the similitude of the source in %JAVA_HOME%\demo\jvmti\heapTracker\src\heapTracker.c.
VC++ 6.0 throws a assert failure when I free the memory allocated by java_crw_demo.dll with the following code:
if (newImage != NULL ) {
free((void *)(newImage)); /* Free malloc() space with free() */
}
The error message is:
Debug Assertion Failed!
Program:c:\WINNT\system32\java.exe
File:dbgheap.c
Line:1011
Expression:_CrtIsValidHeapPointer(pUserData)
What happened?How should I solve this problem?
Thanks!