Fix a memory leak in Server (streams were leaked).
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 16 Apr 2013 20:35:06 +0000 (22:35 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 16 Apr 2013 20:35:06 +0000 (22:35 +0200)
server.cpp

index 24aa84e..8c3382d 100644 (file)
@@ -41,6 +41,12 @@ Server::Server()
 
 Server::~Server()
 {
+       for (map<string, Stream *>::iterator stream_it = streams.begin();
+            stream_it != streams.end();
+            ++stream_it) {
+               delete stream_it->second;
+       }
+
        int ret;
        do {
                ret = close(epoll_fd);