TChromiumWindow.CloseBrowser and onbeforeunload
Posted: Thu May 25, 2023 10:04 pm
https://www.briskbard.com/forum/viewtopic.php?p=156#p156
If I don't care about onbeforeunload, is there any harm in not calling CloseBrowser, and allowing the immediate natural destruction sequence?
TLDR, in my application I have a TFrame based component which hosts the TChromiumWindow. I embed this frame in a modal form for previewing PDF's. If I don't add the CloseBrowser call, I am not noticing any negative impacts using both the debug and release builds of CEF.
In other portions of the application, the same component is used as is (not in a form that we close). When I navigate via an external control to different area's, the container will simply call Object.Free to destroy the old "area browser", to replace that with another component, which may or may not be another TChromiumWindow frame. In this use case, If I do call close browser, then there is a race condition. Because I've been triggered by Free, I would be stuck with the dreaded Application.ProcessMessages.
If I don't care about onbeforeunload, is there any harm in not calling CloseBrowser, and allowing the immediate natural destruction sequence?
TLDR, in my application I have a TFrame based component which hosts the TChromiumWindow. I embed this frame in a modal form for previewing PDF's. If I don't add the CloseBrowser call, I am not noticing any negative impacts using both the debug and release builds of CEF.
In other portions of the application, the same component is used as is (not in a form that we close). When I navigate via an external control to different area's, the container will simply call Object.Free to destroy the old "area browser", to replace that with another component, which may or may not be another TChromiumWindow frame. In this use case, If I do call close browser, then there is a race condition. Because I've been triggered by Free, I would be stuck with the dreaded Application.ProcessMessages.