mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Use "myself" QPointer with "sGui->processEventsToRefreshGui"
Rational: during "sGui->processEventsToRefreshGui" object can be deleted
This commit is contained in:
committed by
Mat Sutcliffe
parent
0e916864cb
commit
bd1ef5dfea
@@ -39,6 +39,7 @@
|
||||
#include <Qt>
|
||||
#include <QtGlobal>
|
||||
#include <QMessageBox>
|
||||
#include <QPointer>
|
||||
|
||||
class QCloseEvent;
|
||||
class QEvent;
|
||||
@@ -122,8 +123,9 @@ void SwiftGuiStd::performGracefulShutdown()
|
||||
ui->comp_MainInfoArea->dockAllWidgets();
|
||||
|
||||
// allow some other parts to react
|
||||
if (!sGui) { return; } // overall shutdown
|
||||
sGui->processEventsToRefreshGui();
|
||||
const QPointer<SwiftGuiStd> myself(this);
|
||||
if (sGui) { sGui->processEventsToRefreshGui(); }
|
||||
if (!sGui || !myself) { return; } // killed in meantime?
|
||||
|
||||
// tell context GUI is going down
|
||||
if (sGui->getIContextApplication())
|
||||
@@ -132,7 +134,7 @@ void SwiftGuiStd::performGracefulShutdown()
|
||||
}
|
||||
|
||||
// allow some other parts to react
|
||||
sGui->processEventsToRefreshGui();
|
||||
if (sGui) { sGui->processEventsToRefreshGui(); }
|
||||
}
|
||||
|
||||
void SwiftGuiStd::closeEvent(QCloseEvent *event)
|
||||
|
||||
Reference in New Issue
Block a user