mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Avoid ASSERT in XPlane "rapid shutdown"
This commit is contained in:
committed by
Mat Sutcliffe
parent
a2a186a2f5
commit
105db27fa8
@@ -635,7 +635,9 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CSimulatorXPlane::physicallyAddRemoteAircraft(const CSimulatedAircraft &newRemoteAircraft)
|
||||
{
|
||||
Q_ASSERT(isConnected());
|
||||
// avoid issue in rapid shutdown
|
||||
if (this->isShuttingDownOrDisconnected()) { return false; }
|
||||
|
||||
// entry checks
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||
Q_ASSERT_X(!newRemoteAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "empty callsign");
|
||||
@@ -684,7 +686,8 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CSimulatorXPlane::physicallyRemoveRemoteAircraft(const CCallsign &callsign)
|
||||
{
|
||||
Q_ASSERT(this->isConnected());
|
||||
// avoid issue in rapid shutdown
|
||||
if (this->isShuttingDownOrDisconnected()) { return false; }
|
||||
|
||||
// only remove from sim
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread");
|
||||
|
||||
Reference in New Issue
Block a user