From: Maxim Mamontov Date: Mon, 12 Sep 2011 08:48:48 +0000 (+0300) Subject: Full and correct rollback in SMUX::Stop method X-Git-Tag: 2.408-rc1~86 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/2b09d57cf981dcdf7ff90befe75dc4f8621a5fad Full and correct rollback in SMUX::Stop method --- diff --git a/projects/stargazer/plugins/other/smux/smux.cpp b/projects/stargazer/plugins/other/smux/smux.cpp index fc45fe04..bcfc940e 100644 --- a/projects/stargazer/plugins/other/smux/smux.cpp +++ b/projects/stargazer/plugins/other/smux/smux.cpp @@ -209,8 +209,6 @@ int SMUX::Stop() printfd(__FILE__, "SMUX::Stop() - Before\n"); running = false; -ResetNotifiers(); - if (!stopped) { //5 seconds to thread stops itself @@ -236,6 +234,22 @@ if (!stopped) pthread_join(thread, NULL); +ResetNotifiers(); + + { + Tables::iterator it; + for (it = tables.begin(); it != tables.end(); ++it) + delete it->second; + } + { + Sensors::iterator it; + for (it = sensors.begin(); it != sensors.end(); ++it) + delete it->second; + } + +tables.erase(tables.begin(), tables.end()); +sensors.erase(sensors.begin(), sensors.end()); + close(sock); printfd(__FILE__, "SMUX::Stop() - After\n");