From a99dd1d6ebf972888bb872441c23c93129466b41 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 26 Nov 2019 03:36:24 -0500 Subject: fixed timing crash when trying to update the lock ui after it was closed --- src/uilocker.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/uilocker.cpp') 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) { -- cgit v1.3.1