Fixed the bug where starting a server made the program crash on closing.

Fixed some memory leaks in Client.cpp.
This commit is contained in:
Jocke
2015-12-09 14:43:43 +01:00
parent ba150a264c
commit 0807a7d0ae
4 changed files with 19 additions and 12 deletions
+3
View File
@@ -44,6 +44,7 @@ void Client::Close()
Disconnect();
m_ThreadIsRunning = false;
m_EventBroker->Unsubscribe(m_EKeyDown);
m_EventBroker->Unsubscribe(m_EKeyUp);
}
}
@@ -78,6 +79,7 @@ void Client::SendToServer()
dataPackage,
len),
m_ReceiverEndpoint, 0);
delete[] dataPackage;
}
if (m_NextSnapshot.inputRight != "") {
char* dataPackage = new char[INPUTSIZE]; // The package that will be sent to the server, when filled
@@ -86,6 +88,7 @@ void Client::SendToServer()
dataPackage,
len),
m_ReceiverEndpoint, 0);
delete[] dataPackage;
}
}