From df241d1585e2ef6be28e38182cdf7e562e9c1a8a Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Fri, 20 Mar 2020 14:06:01 +0100 Subject: Protect against null adapter client OnRenderFrameMetadataChangedAfterActivation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Notification for metadata change is asynchronous and may come after assigned adapter client was destroyed (that is at least what happens in linked test comboBoxPopupPositionAfterChildMove for popup). Fix is similar to 01ee897dc5. Fixes: QTBUG-82987 Change-Id: Ia22ee3c054ed5d5c26982cff579be9d48145f93b Reviewed-by: Jüri Valdmann --- src/core/render_widget_host_view_qt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/render_widget_host_view_qt.cpp') diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 5366fba5f..26ddc807f 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -1882,9 +1882,9 @@ void RenderWidgetHostViewQt::OnRenderFrameMetadataChangedAfterActivation() gfx::SizeF contentsSize = metadata.root_layer_size; std::swap(m_lastScrollOffset, scrollOffset); std::swap(m_lastContentsSize, contentsSize); - if (scrollOffset != m_lastScrollOffset) + if (m_adapterClient && scrollOffset != m_lastScrollOffset) m_adapterClient->updateScrollPosition(toQt(m_lastScrollOffset)); - if (contentsSize != m_lastContentsSize) + if (m_adapterClient && contentsSize != m_lastContentsSize) m_adapterClient->updateContentsSize(toQt(m_lastContentsSize)); } -- cgit v1.2.3