Memory leak

Found a bug in "Everything"? report it here
Post Reply
Gisle Vanem
Posts: 34
Joined: Mon May 04, 2015 10:30 am

Memory leak

Post by Gisle Vanem »

I just installed the Deleaker memory/debug tool.

When using the Everything-SDK in my program, Deleaker reported a memory-leak for the
_Everything_cs critical section setup in _Everything_Initialize().
Since this is never deleted, I patched Everything.c into this:

Code: Select all

void EVERYTHINGAPI Everything_CleanUp(void)
{
    Everything_Reset();
    DeleteCriticalSection(&_Everything_cs);
   _Everything_Initialized = 0;
}
I call Everything_CleanUp() right before my program exit.
Not sure if this is correct thing to do.

But, the leak report in Deleaker vanished. Comments?
void
Developer
Posts: 16753
Joined: Fri Oct 16, 2009 11:31 pm

Re: Memory leak

Post by void »

Thanks for the SDK memory leak report.

This is an oversight on my behalf, sorry.

Your changes to Everything_CleanUp are correct.
I will updated the SDK to include these changes.

Calling DeleteCriticalSection(&_Everything_cs); in Everything_CleanUp and calling Everything_CleanUp on exit should fix the leak.
Gisle Vanem
Posts: 34
Joined: Mon May 04, 2015 10:30 am

Re: Memory leak

Post by Gisle Vanem »

That's good.
Post Reply