This commit is contained in:
Roland Winklmeier
2014-09-02 21:34:34 +02:00
parent 1cbc02a4c5
commit bd8eba6913
2 changed files with 19 additions and 21 deletions

View File

@@ -198,8 +198,6 @@ namespace BlackSimPlugin
if(m_clientStatus == Connected) return hr;
DPN_APPLICATION_DESC dpAppDesc;
QMutexLocker locker(&m_mutexHostList);
QScopedArrayPointer<wchar_t> wszPlayername(new wchar_t[callsign.size() + 1]);
@@ -227,11 +225,11 @@ namespace BlackSimPlugin
}
// Now set up the Application Description
DPN_APPLICATION_DESC dpAppDesc;
ZeroMemory(&dpAppDesc, sizeof(DPN_APPLICATION_DESC));
dpAppDesc.dwSize = sizeof(DPN_APPLICATION_DESC);
dpAppDesc.guidApplication = CFs9Sdk::guid();
// We are now ready to host the app
if( FAILED( hr = m_directPlayPeer->Connect( &dpAppDesc, // AppDesc
m_hostAddress,

View File

@@ -145,23 +145,7 @@ namespace BlackSimPlugin
void CSimulatorFs9::removeRemoteAircraft(const CCallsign &callsign)
{
if(!m_hashFs9Clients.contains(callsign))
return;
CFs9Client *fs9Client = m_hashFs9Clients.value(callsign);
Q_ASSERT(m_fs9ClientThreads.contains(fs9Client));
QThread *fs9ClientThread = m_fs9ClientThreads.value(fs9Client);
QMetaObject::invokeMethod(fs9Client, "disconnectFrom");
m_fs9ClientThreads.remove(fs9Client);
m_hashFs9Clients.remove(callsign);
fs9ClientThread->wait(100);
/*fs9ClientThread->deleteLater();
fs9Client->deleteLater();*/
ps_removeAircraft(callsign.toQString());
}
bool CSimulatorFs9::updateOwnSimulatorCockpit(const CAircraft &ownAircraft)
@@ -337,7 +321,23 @@ namespace BlackSimPlugin
void CSimulatorFs9::ps_removeAircraft(const QString &callsign)
{
removeRemoteAircraft(callsign);
if(!m_hashFs9Clients.contains(callsign)) return;
CFs9Client *fs9Client = m_hashFs9Clients.value(callsign);
Q_ASSERT(m_fs9ClientThreads.contains(fs9Client));
QThread *fs9ClientThread = m_fs9ClientThreads.value(fs9Client);
// Send an async disconnect signal. When finished we will clean up
QMetaObject::invokeMethod(fs9Client, "disconnectFrom");
m_fs9ClientThreads.remove(fs9Client);
m_hashFs9Clients.remove(callsign);
fs9ClientThread->wait(100);
/*fs9ClientThread->deleteLater();
fs9Client->deleteLater();*/
}
void CSimulatorFs9::updateOwnAircraftFromSim(const CAircraft &ownAircraft)