Memory leak

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

Memory leak

Post by Gisle Vanem » Tue Jun 02, 2020 9:16 am

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
Site Admin
Posts: 5458
Joined: Fri Oct 16, 2009 11:31 pm

Re: Memory leak

Post by void » Wed Jun 03, 2020 7:53 am

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: 23
Joined: Mon May 04, 2015 10:30 am

Re: Memory leak

Post by Gisle Vanem » Wed Jun 03, 2020 9:15 am

That's good.

Post Reply