Closed Liminglyq closed 2 years ago
@tishion when can this bug be solved? by the way, are u chinese? I saw you reply someone in chinese
There's a problem in these code `void CefViewBrowserHandler::CloseAllBrowsers(bool force_close) { // If all browsers had been closed, then return std::uniquelockstd::mutex lock(mtx); if (!browsercount) { return; }
// Flip the closing flag isclosing = true;
// Close all popup browsers if any if (!popup_browserlist.empty()) { for (auto it = popup_browserlist.begin(); it != popup_browserlist.end(); ++it) { if (!(it)) continue; auto host = (it)->GetHost(); if (!host) continue; host->CloseBrowser(force_close); } }
if (mainbrowser) { // Request that the main browser close. auto host = mainbrowser->GetHost(); if (host) mainbrowser->GetHost()->CloseBrowser(force_close); }
if (!CefCurrentlyOn(TID_UI)) { // if we are not in browser main thread we need to wait for // all browsers to be closed, while (browsercount) cv_allclosed.wait(lock); } }`
you need to change the code as below, or the void CefViewBrowserHandler::OnBeforeClose(CefRefPtr browser) won't be called
`void CefViewBrowserHandler::CloseAllBrowsers(bool force_close) { // If all browsers had been closed, then return std::uniquelockstd::mutex lock(mtx); if (!browsercount) { return; }
// Flip the closing flag isclosing = true;
// Close all popup browsers if any if (!popup_browserlist.empty()) { for (auto it = popup_browserlist.begin(); it != popup_browserlist.end(); ++it) { if (!(it)) continue; auto host = (it)->GetHost(); if (!host) continue; ::SetParent(host->GetWindowHandle(), NULL); host->CloseBrowser(force_close); } }
if (mainbrowser) { // Request that the main browser close. auto host = mainbrowser->GetHost(); if (host){ ::SetParent(mainbrowser->GetHost()->GetWindowHandle(), NULL); mainbrowser->GetHost()->CloseBrowser(force_close); } }
if (!CefCurrentlyOn(TID_UI)) { // if we are not in browser main thread we need to wait for // all browsers to be closed, while (browsercount) cv_allclosed.wait(lock); } }`
@tishion
i will try to fix this problems later (maybe in June or July), currently i have no time to work on this, sorry.
yes, I am Chinese.
@tishion 太棒了,不用再说蛋疼的英语了。还有个问题,就是开了一个CefWiew之后,关闭再重新开一个会崩溃,我看了下,是QCefManager里面uninitializeCef里面的releaseCef()调用之后,再次调用initializeCef()里面的if (!CefInitialize(main_args, cefsettings, app_, sandboxInfo))崩溃掉了,如果可以一起修复了吧。 辛苦啦!!
这个问题属于已知设计问题,但是现在确实没时间去改。
@tishion 可以禁用cefview吗?就是让鼠标交互无效
@tishion 还有一个问题,就是我在创建qcefview的时候不指定url,后面调用navigatetourl方法,会崩溃,因为 pQCefViewHandler_->GetBrowser()->GetMainFrame()->LoadURL(data); 这里拿到的GetBrowser为空,只有当页面已经显示后调用navigatetourl方法才正常
QCefViewTest,how to exit the app? When I click close the QCefViewTest's windows,the app still running.
QCefViewTest,how to exit the app? When I click close the QCefViewTest's windows,the app still running.
when you close the QCefViewTest's windows, QCefViewTest's top level window ::SendMessage(hWnd, WM_CLOSE, 0, 0);
Duplicate of #24
void QCefViewTest::onBtnNew() { QDir dir = QCoreApplication::applicationDirPath(); QString uri = QDir::toNativeSeparators(dir.filePath("QCefViewTestPage.html")); cefview = new CustomCefView(uri, this); // cefview = new CustomCefView("http://www.google.com/", this); ui.cefContainer->layout()->addWidget(cefview); }
void QCefViewTest::onBtnDelete() { ui.cefContainer->layout()->removeWidget(cefview); delete cefview; cefview = nullptr; }
crash after delete cefview