If so then it doesn't always behave correctly, because sometimes I'm seeing that CefJSDialogHandler::OnResetDialogState and/or CefRequestContextHandler::GetCookieManager are called after OnBeforeClose.
I am also experiencing some other issue, not sure if this is related. Sometimes I am also seeing calls to CefRenderProcessHandler::OnContextReleased in the renderer process after OnBeforeClose was called. In OnBeforeClose when last browser is closed I am releasing a shared request context and during that release a segmentation fault once occured in cef_ref_counted.h. Maybe I should never release a shared request context to avoid such issue?
Testing on Linux, branch 2924.
Doc comment for OnBeforeClose:
- Code: Select all
///
// Called just before a browser is destroyed. Release all references to the
// browser object and do not attempt to execute any methods on the browser
// object after this callback returns. This callback will be the last
// notification that references |browser|. See DoClose() documentation for
// additional usage information.
///
/*--cef()--*/
virtual void OnBeforeClose(CefRefPtr<CefBrowser> browser) {}