4.6 QWebView内存泄漏?

发布于 2024-08-14 22:55:53 字数 412 浏览 1 评论 0原文

我编写了一个快速测试应用程序来在客户端应用程序中使用谷歌分析脚本。使用 QWebView 可以正常工作,

QWebFrame* pFrame = m_pWebView->page()->mainFrame();
pFrame->setContent(arrayHtml);
pFrame->evaluateJavaScript(strScript);

但是无论我做什么,我都无法让它释放内存。每次我调用脚本时,它都会不断添加到进程中使用的内存中。我什至尝试删除 m_pWebView 并且内存使用情况仍然存在。我还尝试了 QWebSettings::clearMemoryCaches() 调用,但没有成功。

这是内存泄漏还是我可以使用其他一些魔法来让它不消耗所有电脑的内存。

I wrote a quick test app to use the google analytics scripts in a client app. It works fine using QWebView and

QWebFrame* pFrame = m_pWebView->page()->mainFrame();
pFrame->setContent(arrayHtml);
pFrame->evaluateJavaScript(strScript);

But no matter what I do I cannot get it to release memory. Every time I call the script it keeps adding to memory used in the process. I even try delete m_pWebView and the memory usage is still there. I also tried the QWebSettings::clearMemoryCaches() call and it did not work.

Is this a memory leak or is there some other magic I can use to get it to not consume all the PC's memory.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文