Ref T232, some (dispatch) timer code was duplicated

* fixed a bug, where a non existing timer was killed
* unified code in base class
This commit is contained in:
Klaus Basan
2018-01-20 07:22:19 +01:00
parent af75c88784
commit dac1ee85f9
6 changed files with 22 additions and 13 deletions

View File

@@ -144,7 +144,7 @@ namespace BlackSimPlugin
m_fsuipc->connect(); // connect FSUIPC too
}
initSimulatorInternals();
m_dispatchTimerId = startTimer(50);
m_timerId = startTimer(50);
return true;
}
@@ -154,8 +154,7 @@ namespace BlackSimPlugin
// Don't forward messages when disconnected
disconnect(m_connectionHostMessages);
killTimer(m_dispatchTimerId);
m_dispatchTimerId = -1;
safeKillTimer();
disconnectAllClients();
// disconnect FSUIPC and status

View File

@@ -102,7 +102,6 @@ namespace BlackSimPlugin
QHash<BlackMisc::Aviation::CCallsign, QPointer<CFs9Client>> m_hashFs9Clients;
QMetaObject::Connection m_connectionHostMessages;
int m_dispatchTimerId = -1;
bool m_simConnected = false; //!< Is simulator connected?
QSharedPointer<CFs9Host> m_fs9Host;
QSharedPointer<CLobbyClient> m_lobbyClient;