mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Exit main thread with winpr_exit to trigger resource cleanup.
When using pthread_once with destructors they are only called, if each thread (including the main thread) is exited with pthread_exit. Introducing winpr_exit as a wrapper for that purpose.
This commit is contained in:
@@ -924,14 +924,14 @@ int main(int argc, char* argv[])
|
||||
instance = freerdp_listener_new();
|
||||
|
||||
if (!instance)
|
||||
return -1;
|
||||
return winpr_exit(-1);
|
||||
|
||||
instance->PeerAccepted = test_peer_accepted;
|
||||
|
||||
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
|
||||
{
|
||||
freerdp_listener_free(instance);
|
||||
return -1;
|
||||
return winpr_exit(-1);
|
||||
}
|
||||
|
||||
/* Open the server socket and start listening. */
|
||||
@@ -942,7 +942,7 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
freerdp_listener_free(instance);
|
||||
WSACleanup();
|
||||
return -1;
|
||||
return winpr_exit(-1);
|
||||
}
|
||||
|
||||
if ((localOnly || instance->Open(instance, NULL, port)) &&
|
||||
@@ -955,6 +955,6 @@ int main(int argc, char* argv[])
|
||||
free(file);
|
||||
freerdp_listener_free(instance);
|
||||
WSACleanup();
|
||||
return 0;
|
||||
return winpr_exit(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user