mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 00:16:51 +08:00
Guard QTimer::singleShot
This commit is contained in:
committed by
Roland Winklmeier
parent
3ecb7b1f94
commit
3f4cb7529c
@@ -35,6 +35,7 @@
|
||||
#include <QToolButton>
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
#include <QPointer>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Network;
|
||||
@@ -453,7 +454,13 @@ namespace BlackGui
|
||||
{
|
||||
std::function<void()> f = m_pendingMessageCalls.front();
|
||||
m_pendingMessageCalls.removeFirst();
|
||||
QTimer::singleShot(500, this, f);
|
||||
const QPointer<COverlayMessages> myself(this);
|
||||
QTimer::singleShot(500, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
f();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user