I have been working with a dll that i have noticed since start that it leak memory. After some fixes it doesn't leak that much but still there is something there leaking.
i got to the point of testing something like this:
keep in mind that i can see the leak because i am running "query" 6000 times.
My question is that anyone has ever noticed something like this? I believe there is a leak in the mirc dll call, but this is just a suspicion. If i unload the dll all the mem is freed.
correct me if I'm wrong (been a rather long time since I last used c++ :-P) but maybe you should clean up the char* yourself in that method or the destructor?
not sure if I'm saying something stupid anymore but java and .net have made me lazy over the years :-P
As a followup, never "cleanup" the *data pointer. mIRC makes use of, and expects it to exist. in fact, it's probably a pointer to a statically allocated structure anyway, so it's not even cleanable.
Rule of thumb: you're only ever responsible to free() what you've malloc()'d... *data isn't your responsibility.