summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-11-26 03:36:24 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2019-11-26 03:36:24 -0500
commita99dd1d6ebf972888bb872441c23c93129466b41 (patch)
treef8a6100728de3f4b1b6bdbabbd1472309b7caa97 /src
parent2527d6aa87f36894c291512a14f12940a5100484 (diff)
fixed timing crash when trying to update the lock ui after it was closed
Diffstat (limited to 'src')
-rw-r--r--src/uilocker.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/uilocker.cpp b/src/uilocker.cpp
index 01794d6b..8c4e0c2c 100644
--- a/src/uilocker.cpp
+++ b/src/uilocker.cpp
@@ -377,6 +377,8 @@ UILocker::~UILocker()
unlock(s.get());
}
}
+
+ g_instance = nullptr;
}
UILocker& UILocker::instance()
@@ -449,6 +451,12 @@ void UILocker::unlockCurrent()
void UILocker::updateLabel()
{
+ if (!m_ui) {
+ // this can happen if the lock overlay was destroyed while a cross-thread
+ // call for updateLabel() was in flight
+ return;
+ }
+
QStringList labels;
for (auto itor=m_sessions.rbegin(); itor!=m_sessions.rend(); ++itor) {