From 2b09d57cf981dcdf7ff90befe75dc4f8621a5fad Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Mon, 12 Sep 2011 11:48:48 +0300 Subject: [PATCH] Full and correct rollback in SMUX::Stop method --- projects/stargazer/plugins/other/smux/smux.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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"); -- 2.43.2