diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server.cpp | 9 | ||||
-rw-r--r-- | src/server.h | 3 | ||||
-rw-r--r-- | src/serversocket.cpp | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp index 981da0c..eb85997 100644 --- a/src/server.cpp +++ b/src/server.cpp | |||
@@ -21,6 +21,15 @@ Bu::Server::Server() : | |||
21 | 21 | ||
22 | Bu::Server::~Server() | 22 | Bu::Server::~Server() |
23 | { | 23 | { |
24 | for( SrvHash::iterator i = hServers.begin(); i != hServers.end(); i++ ) | ||
25 | { | ||
26 | delete *i; | ||
27 | } | ||
28 | |||
29 | for( ClientHash::iterator i = hClients.begin(); i != hClients.end(); i++ ) | ||
30 | { | ||
31 | delete *i; | ||
32 | } | ||
24 | } | 33 | } |
25 | 34 | ||
26 | void Bu::Server::addPort( int nPort, int nPoolSize ) | 35 | void Bu::Server::addPort( int nPort, int nPoolSize ) |
diff --git a/src/server.h b/src/server.h index c4ad4b9..13f5084 100644 --- a/src/server.h +++ b/src/server.h | |||
@@ -86,7 +86,8 @@ namespace Bu | |||
86 | int nTimeoutSec; | 86 | int nTimeoutSec; |
87 | int nTimeoutUSec; | 87 | int nTimeoutUSec; |
88 | fd_set fdActive; | 88 | fd_set fdActive; |
89 | Hash<int,ServerSocket *> hServers; | 89 | typedef Hash<int,ServerSocket *> SrvHash; |
90 | SrvHash hServers; | ||
90 | typedef Hash<int,Client *> ClientHash; | 91 | typedef Hash<int,Client *> ClientHash; |
91 | ClientHash hClients; | 92 | ClientHash hClients; |
92 | }; | 93 | }; |
diff --git a/src/serversocket.cpp b/src/serversocket.cpp index 1908a8a..946d0d3 100644 --- a/src/serversocket.cpp +++ b/src/serversocket.cpp | |||
@@ -66,6 +66,7 @@ Bu::ServerSocket::ServerSocket(const FString &sAddr,int nPort, int nPoolSize) : | |||
66 | 66 | ||
67 | Bu::ServerSocket::~ServerSocket() | 67 | Bu::ServerSocket::~ServerSocket() |
68 | { | 68 | { |
69 | ::close( nServer ); | ||
69 | } | 70 | } |
70 | 71 | ||
71 | void Bu::ServerSocket::startServer( struct sockaddr_in &name, int nPoolSize ) | 72 | void Bu::ServerSocket::startServer( struct sockaddr_in &name, int nPoolSize ) |