Home > Back-end >  Consult the great god, loop dynamic invocation DLL, memory slowly increase
Consult the great god, loop dynamic invocation DLL, memory slowly increase

Time:09-15


While (true) {


HMODULE handle;//HINSTANCE
FARPROC IpFarProc;
Handle=LoadLibrary (L "HardDev");
IpFarProc=GetProcAddress call (handle, "HD_Open");
Bool Ipaddit (*) ();
Ipaddit=(bool (_cdecl *) ()) IpFarProc;

Ipaddit ();

FreeLibrary (handle);


Sleep(1000);
}


Cycle call, can you tell me the reconciliation memory will increase slowly, pointer problem? How to clean up, thank you

CodePudding user response:

This call no problem, you can change the DLL and function to test the handle can not memory leaks (code is no problem),
If such a call no memory leak, the estimate is within the DLL processing has a memory leak, if there is a DLL source code, just look at the inside a DLL function have a memory leak,

CodePudding user response:

To switch to the child to call DLL
  • Related