diff options
-rw-r--r-- | src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index 6dd612999..d56f644d3 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -169,7 +169,14 @@ RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(Rende void RenderWidgetHostViewQtDelegateWidget::removeParentBeforeParentDelete() { + // Unset the parent, because parent is being destroyed, but the owner of this + // RenderWidgetHostViewQtDelegateWidget is actually a RenderWidgetHostViewQt instance. setParent(Q_NULLPTR); + + // If this widget represents a popup window, make sure to close it, so that if the popup was the + // last visible top level window, the application event loop can quit if it deems it necessarry. + if (m_isPopup) + close(); } void RenderWidgetHostViewQtDelegateWidget::initAsChild(WebContentsAdapterClient* container) |