From e6ab9385d8173758222e0f90906116f0ecd1a578 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 3 Jul 2020 18:28:30 +0300 Subject: [PATCH] fix crash when destoying config window --- app/view/settings/primaryconfigview.cpp | 2 +- app/view/settings/viewsettingsfactory.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/view/settings/primaryconfigview.cpp b/app/view/settings/primaryconfigview.cpp index 204550ca1..067ee0211 100644 --- a/app/view/settings/primaryconfigview.cpp +++ b/app/view/settings/primaryconfigview.cpp @@ -125,7 +125,7 @@ PrimaryConfigView::~PrimaryConfigView() delete m_secConfigView; } - if (m_latteView->indicator()) { + if (m_latteView && m_latteView->indicator()) { //! destroy indicator config ui when the configuration window is closed m_latteView->indicator()->releaseConfigUi(); } diff --git a/app/view/settings/viewsettingsfactory.cpp b/app/view/settings/viewsettingsfactory.cpp index be779bd0f..8cd0afb87 100644 --- a/app/view/settings/viewsettingsfactory.cpp +++ b/app/view/settings/viewsettingsfactory.cpp @@ -31,6 +31,9 @@ ViewSettingsFactory::ViewSettingsFactory(QObject *parent) ViewSettingsFactory::~ViewSettingsFactory() { + if (m_primaryConfigView) { + delete m_primaryConfigView; + } } ViewPart::PrimaryConfigView *ViewSettingsFactory::primary(Latte::View *view)