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
+4 -2
View File
@@ -19,6 +19,7 @@ public:
Server();
~Server();
void Start(World* m_world);
void Close();
private:
// udp stuff
@@ -30,15 +31,16 @@ private:
std::clock_t m_StartPingTime;
std::clock_t m_StopTimes[8];
// Game logic
World* m_World;
// Close logic
bool m_ThreadIsRunning = true;
// Threaded
void DisplayLoop();
void ReadFromClients();
void InputLoop();
int Receive(char* data, size_t length);
int CreateMessage(MessageType type, std::string message, char * data);
void MoveMessageHead(char*& data, size_t& length, size_t stepSize);