mirror of
https://github.com/lubosz/overte.git
synced 2025-04-26 17:15:37 +02:00
Fix for crash in QtWebEngineCore when rapidly switching domains
Call stop on the QWebEngineView before destroying OffscreenQMLSurface.
This commit is contained in:
parent
03946748bc
commit
1fc310434e
2 changed files with 11 additions and 0 deletions
interface/resources/qml/controls
libraries/entities-renderer/src
|
@ -27,6 +27,7 @@ Item {
|
|||
|
||||
WebEngineView {
|
||||
id: root
|
||||
objectName: "webEngineView"
|
||||
x: 0
|
||||
y: 0
|
||||
width: parent.width
|
||||
|
|
|
@ -326,7 +326,17 @@ void RenderableWebEntityItem::handlePointerEvent(const PointerEvent& event) {
|
|||
void RenderableWebEntityItem::destroyWebSurface() {
|
||||
if (_webSurface) {
|
||||
--_currentWebCount;
|
||||
|
||||
QQuickItem* rootItem = _webSurface->getRootItem();
|
||||
if (rootItem) {
|
||||
QObject* obj = rootItem->findChild<QObject*>("webEngineView");
|
||||
if (obj) {
|
||||
QMetaObject::invokeMethod(obj, "stop");
|
||||
}
|
||||
}
|
||||
|
||||
_webSurface->pause();
|
||||
|
||||
_webSurface->disconnect(_connection);
|
||||
QObject::disconnect(_mousePressConnection);
|
||||
_mousePressConnection = QMetaObject::Connection();
|
||||
|
|
Loading…
Reference in a new issue