I find that sometime one process of the browser is still running after the browser quits.
I find it in the task manager window, and the CPU usage of the process is high, about 15%.
I don't know the reason of this issue and don't know how to debug it.
Could you give me some advice?
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Sometime one process can't quit
- salvadordf
- Posts: 4304
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Sometime one process can't quit
Hi,
Perhaps this CEF issue is related :
https://github.com/chromiumembedded/cef/issues/3532
It would be extremely helpful to have a step-by-step guide to reproduce that issue with a minimal demo.
Once you have a reliable way to reproduce this issue then you can use this guide to debug it if it's a CEF issue :
https://www.briskbard.com/forum/viewtopic.php?f=10&t=1050
Perhaps this CEF issue is related :
https://github.com/chromiumembedded/cef/issues/3532
It would be extremely helpful to have a step-by-step guide to reproduce that issue with a minimal demo.
Once you have a reliable way to reproduce this issue then you can use this guide to debug it if it's a CEF issue :
https://www.briskbard.com/forum/viewtopic.php?f=10&t=1050
Re: Sometime one process can't quit
Thank you for your information!
This issue is only found in my browser, and occurs randomly. I can't reproduce it with any Demos in cef4Delphi package.
Now, I fixed it by adding some code which kill all processes of the browser after DestroyGlobalCEFApp statement, and it works.
This issue is only found in my browser, and occurs randomly. I can't reproduce it with any Demos in cef4Delphi package.
Now, I fixed it by adding some code which kill all processes of the browser after DestroyGlobalCEFApp statement, and it works.
Re: Sometime one process can't quit
I have run into the same problem. Could you share how you killed the running instances, please?
Re: Sometime one process can't quit
taskkill /pid [mainprocessid] /t /f
replace main process id with GetCurrentProcessId, exec it when form destroy and you'll be fine
replace main process id with GetCurrentProcessId, exec it when form destroy and you'll be fine
Re: Sometime one process can't quit
Sorry, I've not seen your question. I wrote a function to do this.
Code: Select all
procedure KillProcessStillRunning;
var
TempHandle : THandle;
TempProcess : TProcessEntry32;
TempPID : DWORD;
TempProcHWND : HWND;
TempMemCtrs : TProcessMemoryCounters;
TempMain, TempSubProc, TempName : string;
begin
TempHandle := CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
if (TempHandle = INVALID_HANDLE_VALUE) then exit;
ZeroMemory(@TempProcess, SizeOf(TProcessEntry32));
TempProcess.dwSize := Sizeof(TProcessEntry32);
TempPID := GetCurrentProcessID;
Process32First(TempHandle, TempProcess);
repeat
if TempProcess.th32ParentProcessID = TempPID then
begin
TempName := TempProcess.szExeFile;
TerminateProcess(OpenProcess(PROCESS_TERMINATE, BOOL(0),
TempProcess.th32ProcessID),0);
end;
until not(Process32Next(TempHandle, TempProcess));
CloseHandle(TempHandle);
end;