refs #341 Interpret return code before moving on

This commit is contained in:
Roland Winklmeier
2014-10-30 16:53:42 +01:00
parent 8d68dd8188
commit 7701367a1c

View File

@@ -77,8 +77,19 @@ namespace BlackSimPlugin
if (m_hostStatus == Terminated) return hr;
qDebug() << "Terminating host";
hr = m_directPlayPeer->TerminateSession(nullptr, 0, 0);
hr = m_directPlayPeer->Close(0);
if (FAILED(hr = m_directPlayPeer->TerminateSession(nullptr, 0, 0)))
{
qWarning() << "Failed to terminate session!";
return hr;
}
if (FAILED(hr = m_directPlayPeer->Close(0)))
{
qWarning() << "Failed to close peer!";
return hr;
}
m_hostStatus = Terminated;
emit statusChanged(m_hostStatus);