Page 1 of 1

Re: Exception when closing the app

Posted: Sat Jan 19, 2019 9:42 pm
by salvadordf
Hi,

If you use TChromium + TCEFWindowParent then you need to follow the destruction steps described in the SimpleBrowser2 demo.

Code: Select all

// Destruction steps
// =================
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
If you are using a URLRequest you need to cancel all requests before closing the application too.

Re: Exception when closing the app

Posted: Sat Jan 19, 2019 9:46 pm
by salvadordf
I forgot to add one important thing.

Some TChromiumWindow events are executed in the main thread but the TChromium events are executed in a different thread.
You need to destroy TCEFWindowParent in the main thread and that's why SimpleBrowser2 sends a CEFBROWSER_DESTROY message to the form.

Use the SimpleBrowser2 demo as a template.