1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-27 06:03:51 +03:00

release indicator config ui when window closes

This commit is contained in:
Michail Vourlakos 2020-05-12 02:38:01 +03:00
parent 381675ac57
commit e16ca1f87b
3 changed files with 15 additions and 0 deletions

View File

@ -320,6 +320,7 @@ void Indicator::configUiFor(QString type, QQuickItem *parent)
delete m_lastCreatedConfigUi;
m_lastCreatedConfigUi = nullptr;
}
auto prevConfigUi = m_lastCreatedConfigUi;
KPluginMetaData metadata;
@ -353,6 +354,14 @@ void Indicator::configUiFor(QString type, QQuickItem *parent)
}
}
void Indicator::releaseConfigUi()
{
if (m_lastCreatedConfigUi) {
delete m_lastCreatedConfigUi;
m_lastCreatedConfigUi = nullptr;
}
}
void Indicator::unloadIndicators()
{
setPluginIsReady(false);

View File

@ -130,6 +130,7 @@ public slots:
Q_INVOKABLE void addIndicator();
Q_INVOKABLE void downloadIndicator();
Q_INVOKABLE void removeIndicator(QString pluginId);
void releaseConfigUi();
signals:
void customPluginsChanged();

View File

@ -134,6 +134,11 @@ PrimaryConfigView::~PrimaryConfigView()
{
qDebug() << "ConfigView deleting ...";
if (m_latteView->indicator()) {
//! destroy indicator config ui when the configuration window is closed
m_latteView->indicator()->releaseConfigUi();
}
m_corona->dialogShadows()->removeWindow(this);
m_corona->wm()->unregisterIgnoredWindow(KWindowSystem::isPlatformX11() ? winId() : m_waylandWindowId);