Skip to content

Commit 71cb73b

Browse files
committed
Fix CWebServer and CProxyManager destructors to be called while the
application is shutting down (because CWebServerHerper instance is global).
1 parent d875cbf commit 71cb73b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main/WebServerHelper.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,16 @@ namespace http {
7070
void CWebServerHelper::StopServers()
7171
{
7272
for (server_iterator it = serverCollection.begin(); it != serverCollection.end(); ++it) {
73-
(*it)->StopServer();
73+
((CWebServer*) *it)->StopServer();
74+
delete (*it);
7475
}
76+
serverCollection.clear();
7577
#ifndef NOCLOUD
7678
for (proxy_iterator it = proxymanagerCollection.begin(); it != proxymanagerCollection.end(); ++it) {
77-
(*it)->Stop();
79+
((CProxyManager*) *it)->Stop();
80+
delete (*it);
7881
}
82+
proxymanagerCollection.clear();
7983
#endif
8084
}
8185

0 commit comments

Comments
 (0)