mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
refs #935, avoid issues when shutting down
This commit is contained in:
committed by
Mathew Sutcliffe
parent
d475246941
commit
f34e80ea62
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackcore/application.h"
|
||||
|
||||
#include <QFlag>
|
||||
#include <Qt>
|
||||
@@ -83,6 +84,11 @@ namespace BlackCore
|
||||
return m_info.toQString();
|
||||
}
|
||||
|
||||
bool ISimulatorListener::isShuttingDown() const
|
||||
{
|
||||
return (!sApp || sApp->isShuttingDown());
|
||||
}
|
||||
|
||||
void ISimulatorListener::start()
|
||||
{
|
||||
if (m_isRunning) { return; }
|
||||
@@ -92,7 +98,7 @@ namespace BlackCore
|
||||
|
||||
void ISimulatorListener::stop()
|
||||
{
|
||||
if(!m_isRunning) { return; }
|
||||
if (!m_isRunning) { return; }
|
||||
stopImpl();
|
||||
m_isRunning = false;
|
||||
}
|
||||
|
||||
@@ -151,6 +151,9 @@ namespace BlackCore
|
||||
//! Driver will be unloaded
|
||||
virtual void unload() = 0;
|
||||
|
||||
//! Is overall (swift) application shutting down
|
||||
virtual bool isShuttingDown() const = 0;
|
||||
|
||||
//! Set interpolation mode, empty callsign applies to all know callsigns
|
||||
virtual bool setInterpolatorMode(BlackMisc::Simulation::CInterpolatorMulti::Mode mode, const BlackMisc::Aviation::CCallsign &callsign) = 0;
|
||||
|
||||
@@ -253,6 +256,9 @@ namespace BlackCore
|
||||
//! Info about the backend system (if available)
|
||||
virtual QString backendInfo() const;
|
||||
|
||||
//! Overall (swift) application shutting down
|
||||
virtual bool isShuttingDown() const;
|
||||
|
||||
public slots:
|
||||
//! Start listening for the simulator to start.
|
||||
void start();
|
||||
|
||||
@@ -291,6 +291,11 @@ namespace BlackCore
|
||||
this->m_remoteAircraftProviderConnections.disconnectAll(); // disconnect signals from provider
|
||||
}
|
||||
|
||||
bool CSimulatorCommon::isShuttingDown() const
|
||||
{
|
||||
return (!sApp || sApp->isShuttingDown());
|
||||
}
|
||||
|
||||
void CSimulatorCommon::setInterpolationAndRenderingSetup(const CInterpolationAndRenderingSetup &setup)
|
||||
{
|
||||
{
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace BlackCore
|
||||
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const override;
|
||||
virtual void setWeatherActivated(bool activated) override;
|
||||
virtual void unload() override;
|
||||
virtual bool isShuttingDown() const override;
|
||||
virtual int physicallyRemoveMultipleRemoteAircraft(const BlackMisc::Aviation::CCallsignSet &callsigns) override;
|
||||
|
||||
//! \addtogroup swiftdotcommands
|
||||
|
||||
Reference in New Issue
Block a user