- Code: Select all
[0602/140157.190:WARNING:discardable_shared_memory_manager.cc(436)] Some MojoDiscardableSharedMemoryManagerImpls are still alive. They will be leaked.
[0602/140157.194:FATAL:interface_endpoint_client.cc(170)] Check failed: (sequence_checker_).CalledOnValidSequence().
And it breaks at:
So what I could already figure out is that it only happens when I create a browser, without it I seem to be handling references correctly. Some additional information: I am using windowless single process mode. And here are some bits of my code:
- Code: Select all
void WebCore::onApplicationReady() const {
CefWindowInfo windowInfo;
windowInfo.SetAsWindowless(mWindow->getHandle());
CefBrowserSettings browserSettings;
browserSettings.background_color = 0;
CefBrowserHost::CreateBrowser(windowInfo, mWebClient, "", browserSettings, nullptr);
}
This is called in response to CefBrowserProcessHandler::OnContextInitialized. If I uncomment the CreateBrowser everything works fine.
When the window is closed and its time to shutdown the following is called (on mWebClient):
- Code: Select all
void WebClient::shutdown() {
if(mLocalBrowser == nullptr) {
mWebCore->onBrowserClosed();
} else {
mRemoteBrowser = nullptr;
mLocalBrowser->StopLoad();
mLocalBrowser->GetHost()->SetFocus(false);
mLocalBrowser->GetHost()->CloseBrowser(true);
}
}
mLocalBrowser is saved from OnAfterCreated from CefLifespanHandler. mRemoteBrowser is in theory taken from CefRenderProcessHandler::OnContextCreated for JS interaction later, however it is commented out and always nulltptr for now.
The following is triggered from OnBeforeClose:
- Code: Select all
void WebClient::onBrowserClosed() {
mLocalBrowser = nullptr;
mWebCore->onBrowserClosed();
}
This in return causes this:
- Code: Select all
void WebCore::onBrowserClosed() const {
CefPostTask(TID_UI, base::Bind(CefQuitMessageLoop));
}
Which breaks the message loop and gets here:
- Code: Select all
CefRunMessageLoop();
CefClearSchemeHandlerFactories();
mWebClient = nullptr;
mLocalScheme = nullptr;
mLogger.info("Shutting down CEF");
CefShutdown();
mApplication = nullptr;
I am not really sure which references are still alive, because this is what I see when debugging:
- In WebClient::onBrowserClosed: WebClient has 2 references, mLocalBrowser has 1 reference when I stepp through the nullptr assignment and it gets deleted.
- After CefRunMessageLoop the mWebClient has 1 reference, the mLocalScheme has 2 references and mApplication has 2 references.
If I can provide more details please let me know!
BR
Cromon