1
0

Added network termination called at app exit.

This fixes a crash in MSVC runtime caused by joining a thread in a global var's destructor.
This commit is contained in:
Mattes D
2015-01-26 14:46:20 +01:00
parent 9a2200f8bb
commit 053362e604
6 changed files with 91 additions and 18 deletions

View File

@@ -7,6 +7,7 @@
#include <iostream>
#include <string>
#include "OSSupport/Network.h"
#include "OSSupport/NetworkSingleton.h"
@@ -98,7 +99,7 @@ class cEchoServerCallbacks:
int main()
void DoTest(void)
{
LOGD("EchoServer: starting up");
cServerHandlePtr Server = cNetwork::Listen(9876, std::make_shared<cEchoServerCallbacks>());
@@ -119,9 +120,20 @@ int main()
Server->Close();
ASSERT(!Server->IsListening());
LOGD("Server has been closed.");
}
int main()
{
DoTest();
printf("Press enter to exit test.\n");
AString line;
std::getline(std::cin, line);
cNetworkSingleton::Get().Terminate();
LOG("Network test finished.");
return 0;