Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: QCefViwe释放 Crash #345

Open
double-ing opened this issue Nov 6, 2023 · 2 comments
Open

[BUG]: QCefViwe释放 Crash #345

double-ing opened this issue Nov 6, 2023 · 2 comments

Comments

@double-ing
Copy link

Describe the bug 【Bug描述】

...
使用OSR模式, 因为一些网页首次加载较耗时, 采用"提前加载"一些网页以达到提速的效果, 这时创建的QCefView是隐藏的, 在释放QCefView的时候发生Crash, 后发现正常显示的内嵌页也有Crash现象,只是Crash的较少, 原因都是主线程释放QCefVew/Private时, 后台线程会通用CCefClientDelegate访问资源,一共有下面几个场景

  1. CefViewBrowserClient::GetViewRect(CefRefPtr browser, CefRect& rect)
    内部delegate为空时返回的窗口size为0导致内部Crash, 该问题已修复
  2. CCefClientDelegate::faviconChanged(CefRefPtr image)
    内部pCefViewPrivate_->q_ptr->faviconChanged(icon);// 此时q_ptr已释放导致信号发送Crash,通过将pCefViewPrivate通过QPointer定义解决
  3. CefViewBrowserClient::OnFaviconURLChange(CefRefPtr browser, const std::vector& icon_urls)
    内部delegate->faviconURLChanged(browser, icon_urls); Crash,
    当问题3出来时感觉这是一类问题, 感觉通过判空从根本上无法解决这类问题, 请教如何解决该类问题, 3Q

To Reproduce 【复现步骤】

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error
  5. 以上问题均通过bugsplat采集的用户数据, 1、2本地通过调试断点可稳定复现(让QCefView先释放)

Expected behavior 【正确的预期行为】

...

Screenshots 【截图】

...
image

image

image

Environment 【BUG产生的环境】

  • OSR/NCW Mode: OSR
  • OS & Version: [e.g. Windows/macOS/Linux] Windows
  • Qt Version: 5.15.2
  • CEF Version: 89.0.4389.114
    工作模式采用独立进程A管理QCefView(主要做网页预加载及创建QCefView然后嵌入主程序), 主程序B启动内嵌页时将A进程窗口句柄内嵌到主程序中实现,

Additional context 【更多额外信息】

...

@L-Super
Copy link
Member

L-Super commented Nov 15, 2023

对于已知问题,欢迎提交PR。

@L-Super
Copy link
Member

L-Super commented Mar 8, 2024

对于问题2,由于稳定性问题,目前已移除此接口。
对于问题3,CefView/CefViewCore@a6969ff 应该修复了此问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants