hi,
I am receiving the attached crash dump on exiting the application. This looks to be a crash happening in libcef.dll in windows 7 and win10.
Can you please let me know what is the best way to force terminate a CEF based C++ windows application.
Currently this is what i have in my exit code
void killProcessByName(wstring filename)
{
HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, NULL);
PROCESSENTRY32 pEntry;
pEntry.dwSize = sizeof(pEntry);
BOOL hRes = Process32First(hSnapShot, &pEntry);
while (hRes)
{
if (wcscmp(pEntry.szExeFile, filename.c_str()) == 0)
{
HANDLE hProcess = OpenProcess(PROCESS_TERMINATE, 0,
(DWORD)pEntry.th32ProcessID);
if (hProcess != NULL)
{
TerminateProcess(hProcess, 9);
CloseHandle(hProcess);
}
}
hRes = Process32Next(hSnapShot, &pEntry);
}
CloseHandle(hSnapShot);
}
void ApplicationLogOutCommand::execute(const jsoncons::wjson &input, jsoncons::wjson &out) {
try {
CefShutdown();
killProcessByName(L"sample-cef.exe");
}
catch (std::runtime_error) {
exit(0);
}
}