From: Steinar H. Gunderson Date: Tue, 16 Apr 2013 20:38:09 +0000 (+0200) Subject: Stop leaking the mark pools. X-Git-Tag: 1.0.0~85 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=433df75e414444dc9c9f32dbef264531105e47b7 Stop leaking the mark pools. --- diff --git a/main.cpp b/main.cpp index be3e8eb..9514270 100644 --- a/main.cpp +++ b/main.cpp @@ -32,6 +32,7 @@ using namespace std; AccessLogThread *access_log = NULL; ServerPool *servers = NULL; +vector mark_pools; volatile bool hupped = false; volatile bool stopped = false; @@ -142,7 +143,6 @@ void create_streams(const Config &config, const set &deserialized_stream_ids, map *deserialized_inputs) { - vector mark_pools; // FIXME: leak for (unsigned i = 0; i < config.mark_pools.size(); ++i) { const MarkPoolConfig &mp_config = config.mark_pools[i]; mark_pools.push_back(new MarkPool(mp_config.from, mp_config.to)); @@ -430,6 +430,12 @@ start: } } delete servers; + + for (unsigned i = 0; i < mark_pools.size(); ++i) { + delete mark_pools[i]; + } + mark_pools.clear(); + access_log->stop(); delete access_log; shut_down_logging();