Click to See Complete Forum and Search --> : Static Class in DLL calling function in Dynamic DLL =Memory Leak?


OniDaito
November 23rd, 2005, 05:37 AM
Hi. I've had a good search around the forums and I havent managed to find an thoughts on this but if there is one, sorry for the duplicate post.

Right. Essentially my EXE has a static DLL (one with a stub .LIB file) and it calls a function inside that static lib. However.... when that function is called, the DLL must initialise itself. During this init step, a static class is created. The static class has a contructor which calls a function inside that DLL. That function calls and loads a set of DYNAMIC DLL's and asks them to load and save a file. However, somewhere theres a memory leak... Im wondering if what im attempting wont work... the code used to have an init() , doStuff() and destroy() funtions and these worked, but using the static class is neater although it doesnt seem to work.

So lets summarise:

EXE command -> Static DLL Function Call -> Static Class Instantiation -> Load DLL -> Loaded DLL Reads File = MEMORY Leak

I can perhaps post some code here if needed. But I guess i need to know a little more about how DLL's initialise themselves... maybe thats the ticket?