Submitted By: Douglas R. Reno Date: 2019-01-19 Initial Package Version: 5.13.0 Upstream Status: Applied Origin: Upstream Description: Fixes background rendering problems in Falkon, and crashes on multimedia-heavy sites (such as Twitch, YouTube, Mixer, DLive, The Register, and several others). diff -Naurp qtwebengine-everywhere-src-5.13.0.orig/src/core/compositor/compositor_resource_tracker.cpp qtwebengine-everywhere-src-5.13.0/src/core/compositor/compositor_resource_tracker.cpp --- qtwebengine-everywhere-src-5.13.0.orig/src/core/compositor/compositor_resource_tracker.cpp 2019-05-24 04:01:39.000000000 -0500 +++ qtwebengine-everywhere-src-5.13.0/src/core/compositor/compositor_resource_tracker.cpp 2019-07-23 13:39:37.252598564 -0500 @@ -174,7 +174,8 @@ quint32 CompositorResourceTracker::consu DCHECK(mailboxManager); if (mailboxHolder.sync_token.HasData()) mailboxManager->PullTextureUpdates(mailboxHolder.sync_token); - return service_id(mailboxManager->ConsumeTexture(mailboxHolder.mailbox)); + gpu::TextureBase *tex = mailboxManager->ConsumeTexture(mailboxHolder.mailbox); + return tex ? service_id(tex) : 0; #else NOTREACHED(); #endif // QT_CONFIG(OPENGL) diff -Naurp qtwebengine-everywhere-src-5.13.0.orig/src/core/web_contents_adapter.cpp qtwebengine-everywhere-src-5.13.0/src/core/web_contents_adapter.cpp --- qtwebengine-everywhere-src-5.13.0.orig/src/core/web_contents_adapter.cpp 2019-05-24 04:01:39.000000000 -0500 +++ qtwebengine-everywhere-src-5.13.0/src/core/web_contents_adapter.cpp 2019-07-23 13:42:27.555646841 -0500 @@ -671,19 +671,22 @@ void WebContentsAdapter::load(const QWeb } } - auto navigate = [](WebContentsAdapter *adapter, const content::NavigationController::LoadURLParams ¶ms) { - adapter->webContents()->GetController().LoadURLWithParams(params); + auto navigate = [](QWeakPointer weakAdapter, const content::NavigationController::LoadURLParams ¶ms) { + WebContentsAdapter *adapter = weakAdapter.data(); + if (!adapter) + return; // Follow chrome::Navigate and invalidate the URL immediately. adapter->m_webContentsDelegate->NavigationStateChanged(adapter->webContents(), content::INVALIDATE_TYPE_URL); adapter->focusIfNecessary(); }; + QWeakPointer weakThis(sharedFromThis()); if (resizeNeeded) { // Schedule navigation on the event loop. base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI}, - base::BindOnce(navigate, this, std::move(params))); + base::BindOnce(navigate, std::move(weakThis), std::move(params))); } else { - navigate(this, params); + navigate(std::move(weakThis), params); } }