mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-01 14:45:42 +08:00
Prevent killing timer with wrong id
This commit is contained in:
@@ -69,9 +69,9 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CLoadIndicator::setAnimationDelay(int delay)
|
void CLoadIndicator::setAnimationDelay(int delay)
|
||||||
{
|
{
|
||||||
if (this->m_timerId != -1) { killTimer(this->m_timerId); }
|
|
||||||
this->m_delayMs = delay;
|
this->m_delayMs = delay;
|
||||||
if (this->m_timerId != -1) { this->m_timerId = startTimer(this->m_delayMs); }
|
if (this->m_timerId != -1) { killTimer(this->m_timerId); }
|
||||||
|
this->m_timerId = startTimer(this->m_delayMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLoadIndicator::setColor(const QColor &color)
|
void CLoadIndicator::setColor(const QColor &color)
|
||||||
|
|||||||
@@ -104,11 +104,8 @@ namespace BlackSimPlugin
|
|||||||
bool CSimulatorFsx::disconnectFrom()
|
bool CSimulatorFsx::disconnectFrom()
|
||||||
{
|
{
|
||||||
if (!m_simConnected) { return true; }
|
if (!m_simConnected) { return true; }
|
||||||
if (m_simconnectTimerId >= 0)
|
if (m_simconnectTimerId >= 0) { killTimer(m_simconnectTimerId); }
|
||||||
{
|
m_simconnectTimerId = -1;
|
||||||
killTimer(m_simconnectTimerId);
|
|
||||||
m_simconnectTimerId = -1;
|
|
||||||
}
|
|
||||||
if (m_hSimConnect)
|
if (m_hSimConnect)
|
||||||
{
|
{
|
||||||
SimConnect_Close(m_hSimConnect);
|
SimConnect_Close(m_hSimConnect);
|
||||||
@@ -1042,15 +1039,11 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
void CSimulatorFsx::reset()
|
void CSimulatorFsx::reset()
|
||||||
{
|
{
|
||||||
if (m_simconnectTimerId >= 0)
|
if (m_simconnectTimerId >= 0) { killTimer(m_simconnectTimerId); }
|
||||||
{
|
m_simconnectTimerId = -1;
|
||||||
killTimer(m_simconnectTimerId);
|
|
||||||
m_simconnectTimerId = -1;
|
|
||||||
}
|
|
||||||
m_simConnected = false;
|
m_simConnected = false;
|
||||||
m_simSimulating = false;
|
m_simSimulating = false;
|
||||||
m_syncDeferredCounter = 0;
|
m_syncDeferredCounter = 0;
|
||||||
m_simconnectTimerId = -1;
|
|
||||||
m_skipCockpitUpdateCycles = 0;
|
m_skipCockpitUpdateCycles = 0;
|
||||||
m_interpolationRequest = 0;
|
m_interpolationRequest = 0;
|
||||||
m_interpolationsSkipped = 0;
|
m_interpolationsSkipped = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user