mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 11:05:44 +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)
|
bool CSimulatorXPlane::physicallyAddRemoteAircraft(const CSimulatedAircraft &newRemoteAircraft)
|
||||||
{
|
{
|
||||||
Q_ASSERT(isConnected());
|
// avoid issue in rapid shutdown
|
||||||
|
if (this->isShuttingDownOrDisconnected()) { return false; }
|
||||||
|
|
||||||
// entry checks
|
// entry checks
|
||||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
|
||||||
Q_ASSERT_X(!newRemoteAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "empty callsign");
|
Q_ASSERT_X(!newRemoteAircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "empty callsign");
|
||||||
@@ -684,7 +686,8 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
bool CSimulatorXPlane::physicallyRemoveRemoteAircraft(const CCallsign &callsign)
|
bool CSimulatorXPlane::physicallyRemoveRemoteAircraft(const CCallsign &callsign)
|
||||||
{
|
{
|
||||||
Q_ASSERT(this->isConnected());
|
// avoid issue in rapid shutdown
|
||||||
|
if (this->isShuttingDownOrDisconnected()) { return false; }
|
||||||
|
|
||||||
// only remove from sim
|
// only remove from sim
|
||||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread");
|
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "wrong thread");
|
||||||
|
|||||||
Reference in New Issue
Block a user