VS _CrtSetDbgFlag stops working if I initialize CEF

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

VS _CrtSetDbgFlag stops working if I initialize CEF

Postby Cherno » Mon May 11, 2015 1:17 am

Hello,

I have noticed that if I initialize CEF (2272, Win32) visual studio debug leak detector stops working.

I am using
Code: Select all
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
in order to catch memory leaks when my app exits, but if I initialize CEF, it doesn´t work at all.

I don´t know if it´s because I am using the same executable for the additional processes ant that breaks VS detector or it´s something internal in CEF/Chrome using the same functionality to internally catch leaks.

Any idea of what could be the issue?

C.
Cherno
Techie
 
Posts: 11
Joined: Thu Apr 09, 2015 5:55 am

Re: VS _CrtSetDbgFlag stops working if I initialize CEF

Postby Cherno » Tue May 12, 2015 1:30 am

There seem to be a bug in Windows versions prior to 8.1, I solved it following this thread :

https://social.msdn.microsoft.com/Forums/vstudio/en-US/8cb1847d-3218-4610-9cb8-6905bd255ff5/no-dllprocessdetach-after-calling-playsound-on-windows-7-64bit

And I ended adding the LoadLibrary just at the start of WinMain, in order to make it work again :

Code: Select all
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
    hPrevInstance; nShowCmd;

    #if ENABLE_MEMORY_LEAK_DETECTOR_TEST
        LoadLibrary("setupapi.dll");
    #endif

    ...
Cherno
Techie
 
Posts: 11
Joined: Thu Apr 09, 2015 5:55 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 79 guests