refs #935, avoid issues when shutting down

This commit is contained in:
Klaus Basan
2017-04-13 01:06:05 +02:00
committed by Mathew Sutcliffe
parent d475246941
commit f34e80ea62
5 changed files with 20 additions and 2 deletions

View File

@@ -1356,7 +1356,7 @@ namespace BlackSimPlugin
void CSimulatorFsxCommonListener::checkConnection()
{
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing sApp");
if (this->isShuttingDown()) { return; }
Q_ASSERT_X(!CThreadUtils::isCurrentThreadApplicationThread(), Q_FUNC_INFO, "Expect to run in background");
HANDLE hSimConnect;
HRESULT result = SimConnect_Open(&hSimConnect, sApp->swiftVersionChar(), nullptr, 0, 0, 0);