mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 04:08:13 +02:00
Merge pull request #13638 from jherico/fix/fb16762
Fix for audio continuing on destroyed Web 3D overlays
This commit is contained in:
commit
74a49dc14f
1 changed files with 7 additions and 5 deletions
|
@ -138,11 +138,8 @@ void Web3DOverlay::destroyWebSurface() {
|
||||||
// Fix for crash in QtWebEngineCore when rapidly switching domains
|
// Fix for crash in QtWebEngineCore when rapidly switching domains
|
||||||
// Call stop on the QWebEngineView before destroying OffscreenQMLSurface.
|
// Call stop on the QWebEngineView before destroying OffscreenQMLSurface.
|
||||||
if (rootItem) {
|
if (rootItem) {
|
||||||
QObject* obj = rootItem->findChild<QObject*>("webEngineView");
|
// stop loading
|
||||||
if (obj) {
|
QMetaObject::invokeMethod(rootItem, "stop");
|
||||||
// stop loading
|
|
||||||
QMetaObject::invokeMethod(obj, "stop");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_webSurface->pause();
|
_webSurface->pause();
|
||||||
|
@ -152,6 +149,11 @@ void Web3DOverlay::destroyWebSurface() {
|
||||||
|
|
||||||
// If the web surface was fetched out of the cache, release it back into the cache
|
// If the web surface was fetched out of the cache, release it back into the cache
|
||||||
if (_cachedWebSurface) {
|
if (_cachedWebSurface) {
|
||||||
|
// If it's going back into the cache make sure to explicitly set the URL to a blank page
|
||||||
|
// in order to stop any resource consumption or audio related to the page.
|
||||||
|
if (rootItem) {
|
||||||
|
rootItem->setProperty("url", "about:blank");
|
||||||
|
}
|
||||||
auto offscreenCache = DependencyManager::get<OffscreenQmlSurfaceCache>();
|
auto offscreenCache = DependencyManager::get<OffscreenQmlSurfaceCache>();
|
||||||
// FIXME prevents crash on shutdown, but we shoudln't have to do this check
|
// FIXME prevents crash on shutdown, but we shoudln't have to do this check
|
||||||
if (offscreenCache) {
|
if (offscreenCache) {
|
||||||
|
|
Loading…
Reference in a new issue