Page 1 of 2

Error on exit when MultiThreadedMessageLoop is disabled

Posted: Sat Nov 25, 2017 8:02 pm
by xpert13
Can you explain me why my app show me an error when I try to disable MultiThreadedMessageLoop?

Code: Select all

GlobalCEFApp.MultiThreadedMessageLoop := False;
Image

Re: Error on exit when MultiThreadedMessageLoop is disabled

Posted: Sun Nov 26, 2017 9:59 am
by salvadordf
I've added an issue to github about this problem :
https://github.com/salvadordf/CEF4Delphi/issues/71

For now, there's no fix for that crash.

Re: Error on exit when MultiThreadedMessageLoop is disabled

Posted: Tue Nov 28, 2017 6:52 pm
by xpert13
Any ideas how to fix it?

I tried to find solution in Google but got no results :(

Re: Error on exit when MultiThreadedMessageLoop is disabled

Posted: Tue Nov 28, 2017 7:17 pm
by salvadordf
Nothing yet... I'll keep looking.

Re: Error on exit when MultiThreadedMessageLoop is disabled

Posted: Tue Nov 28, 2017 10:12 pm
by salvadordf
The CEF3 code comments recommend to use GlobalCEFApp.MultiThreadedMessageLoop := False with GlobalCEFApp.ExternalMessagePump := True.
In that case we have to use the GlobalCEFApp.OnScheduleMessagePumpWork event to schedule the calls to CefDoMessageLoopWork.

The official CEF3 sample application use this event but the CEF4Delphi demos don't use it and it could be a clue of what's causing this problem.

I'll keep looking as soon as I can...

Re: Error on exit when MultiThreadedMessageLoop is disabled

Posted: Wed Nov 29, 2017 8:02 pm
by xpert13
I don't think that it will fix this error.

I tried to use cef_run_message_loop instead calling cef_do_message_loop_work in timer and it's didn't help. Application crashed with the same error on exit;

Re: Error on exit when MultiThreadedMessageLoop is disabled

Posted: Tue Dec 05, 2017 9:45 am
by salvadordf
I fixed the issue but you'll have to set GlobalCEFApp.ExternalMessagePump to True too.

Please, download the latest CEF4Delphi version and read this :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=222

Re: Error on exit when MultiThreadedMessageLoop is disabled

Posted: Wed Dec 06, 2017 8:26 pm
by xpert13
Thank a lot for your help. But I can't understand how to destroy browser properly. I didn't use TCEFWindowParent. What I need to write in this function?

Code: Select all

procedure TExternalPumpBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
begin
  CEFWindowParent1.Free;
end;

Re: Error on exit when MultiThreadedMessageLoop is disabled

Posted: Wed Dec 06, 2017 8:39 pm
by salvadordf
I'll add another demo for the TChromiumWindow tomorrow ;)

Edit : I think I answered too fast... I'll take a look tomorrow but it's possible you may have to use TChromium + TCEFWindowParent combination.

Re: Error on exit when MultiThreadedMessageLoop is disabled

Posted: Wed Dec 06, 2017 8:43 pm
by xpert13
Thank you. You are the best!!!