regarding spawning issue with my application

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

regarding spawning issue with my application

Postby giridharb54 » Mon Dec 16, 2013 4:25 am

Hi all,

I am using seperate executable for render process by using below code
Code: Select all
     int exit_code = CefExecuteProcess(main_args,NULL);
   if (exit_code >= 0) {
    // The sub-process terminated, exit now.
    return exit_code;
    }
    const char *path= "C:\\MangoFeatures_Win8\\Deployment\\ThirdParty\\Cef3\\SubProcApp\\SubProc\\Debug\\SubProc.exe";
    CefString(&appSettings.browser_subprocess_path).FromASCII(path);
   

Its spawns subproc.exe for render process.
However when i close the browser the subproc.exe doesnt get killed. How to kill subproc.exe ?? and how to run subproc.exe in background???
giridharb54
Expert
 
Posts: 100
Joined: Thu Oct 17, 2013 2:15 am

Re: regarding spawning issue with my application

Postby giridharb54 » Mon Dec 16, 2013 6:46 am

I am not using cefshutdown in my application. If I use cefshutdown my application crashes. But also by using cefshutdown it solves the problem of killing the subprocess. Please let me know how to solve this problem
giridharb54
Expert
 
Posts: 100
Joined: Thu Oct 17, 2013 2:15 am

Re: regarding spawning issue with my application

Postby magreenblatt » Mon Dec 16, 2013 9:16 am

You need to call CefShutdown. What is the call stack for the crash?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: regarding spawning issue with my application

Postby giridharb54 » Mon Dec 16, 2013 1:16 pm

I am not able to get the call stack. the moment i call cefshutdown, the application hangs. I am using cefdomessageloopwork() in the message loop. Can i call cefshutdown() on WM_CLOSE ??? also the subproc .exe which is spawned opens as a command prompt. how to run it as a background process???
giridharb54
Expert
 
Posts: 100
Joined: Thu Oct 17, 2013 2:15 am

Re: regarding spawning issue with my application

Postby magreenblatt » Mon Dec 16, 2013 1:26 pm

You need to call CefShutdown after the application message loop has exited.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: regarding spawning issue with my application

Postby giridharb54 » Tue Dec 17, 2013 9:28 am

Hi ,

I have an MDI application, so how to call cefshutdown ?? should i call it after WM_CLOSE?? Also my other question was how to run subproc.exe as a background process?? Currently it is launching a command prompt as subproc.exe
giridharb54
Expert
 
Posts: 100
Joined: Thu Oct 17, 2013 2:15 am

Re: regarding spawning issue with my application

Postby magreenblatt » Tue Dec 17, 2013 9:46 am

giridharb54 wrote:I have an MDI application, so how to call cefshutdown ?? should i call it after WM_CLOSE??

That depends on what framework you're using. You need to call CefShutdown after the framework's message loop has terminated. That won't be when you receive the WM_CLOSE message, since that message is delivered via the message loop.

giridharb54 wrote:Also my other question was how to run subproc.exe as a background process?? Currently it is launching a command prompt as subproc.exe

Is it launching a command prompt with the Release build executable? What compiler and Windows version are you using? Did you configure the subsystem to WINDOWS?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: regarding spawning issue with my application

Postby giridharb54 » Wed Dec 18, 2013 3:38 am

Hi Magreenblat,

I have a MDI application and the framework is win32 api.After i close my embedded browser window , main application loop keeps running. So when to call cefshutdown??. Also suppose i have 10 embedded browser window is open in my application it will spawn 10 subproc.exe. One call to cefshutdown() will kill all the 10 subproc.exe(render process)??? so should i call cefshutdown() when application teminates ?? Is there a way to kill subproc.exe(render process) on close of corresponding browser window??. Regarding the command prompt opening for the render process is only seen in win 8 debug. Let us know how to solve this issue also.
giridharb54
Expert
 
Posts: 100
Joined: Thu Oct 17, 2013 2:15 am

Re: regarding spawning issue with my application

Postby giridharb54 » Wed Dec 18, 2013 3:08 pm

Hi MagrrenBlat,

Can ypu please reply asap on the above post or question asked???
giridharb54
Expert
 
Posts: 100
Joined: Thu Oct 17, 2013 2:15 am

Re: regarding spawning issue with my application

Postby magreenblatt » Wed Dec 18, 2013 11:17 pm

Call CefShutdown at the end of your WinMain function. Subprocesses will be killed by Chromium shortly after the associated browser(s) are destroyed. The debug console is a known issue without resolution at this time.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Next

Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 127 guests