mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
Set timer id to invalid once it got killed
After two consecutive calls to CSimulatorFsx::reset(), the timer was killed again in the second call. This caused an internal Qt warning, since the id is unknown after it got killed in the first call.
This commit is contained in:
committed by
Klaus Basan
parent
d6deb077a7
commit
2e5176ebcc
@@ -104,7 +104,11 @@ namespace BlackSimPlugin
|
||||
bool CSimulatorFsx::disconnectFrom()
|
||||
{
|
||||
if (!m_simConnected) { return true; }
|
||||
if (m_simconnectTimerId) { killTimer(m_simconnectTimerId); }
|
||||
if (m_simconnectTimerId >= 0)
|
||||
{
|
||||
killTimer(m_simconnectTimerId);
|
||||
m_simconnectTimerId = -1;
|
||||
}
|
||||
if (m_hSimConnect)
|
||||
{
|
||||
SimConnect_Close(m_hSimConnect);
|
||||
@@ -1038,7 +1042,11 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorFsx::reset()
|
||||
{
|
||||
if (m_simconnectTimerId >= 0) { killTimer(m_simconnectTimerId); }
|
||||
if (m_simconnectTimerId >= 0)
|
||||
{
|
||||
killTimer(m_simconnectTimerId);
|
||||
m_simconnectTimerId = -1;
|
||||
}
|
||||
m_simConnected = false;
|
||||
m_simSimulating = false;
|
||||
m_syncDeferredCounter = 0;
|
||||
|
||||
Reference in New Issue
Block a user