]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #1618 in SNORT/snort3 from ~SBAIGAL/snort3:perf_mon_analyzer_fix...
authorMichael Altizer (mialtize) <mialtize@cisco.com>
Tue, 4 Jun 2019 15:12:44 +0000 (11:12 -0400)
committerMichael Altizer (mialtize) <mialtize@cisco.com>
Tue, 4 Jun 2019 15:12:44 +0000 (11:12 -0400)
Squashed commit of the following:

commit ad4244beb09c4a56e10c6751c0ae51bd81fdeaa2
Author: Steven Baigal (sbaigal) <sbaigal@cisco.com>
Date:   Tue May 28 09:29:19 2019 -0400

    perf_mon: removed flow_ip_handler from PerfMonitor

    Keep the ip event handler at databus, disable ip tracker from a thread will not lead to delete ip data handler from databus

src/network_inspectors/perf_monitor/perf_monitor.cc

index e53fbd139c698709affb6ff6afe0725b8bcf10de..8306e9316559f2596b0a02b310482b4df903e7cf 100644 (file)
@@ -77,7 +77,6 @@ public:
 
 private:
     PerfConfig* const config;
-    FlowIPDataHandler* flow_ip_handler = nullptr;
 
     void disable_tracker(size_t);
 };
@@ -206,11 +205,7 @@ void PerfMonitor::disable_tracker(size_t i)
     auto tracker = trackers->at(i);
 
     if ( tracker == flow_ip_tracker )
-    {
-        DataBus::unsubscribe_default(FLOW_STATE_EVENT, flow_ip_handler);
-        delete flow_ip_handler;
         flow_ip_tracker = nullptr;
-    }
 
     (*trackers)[i] = (*trackers)[trackers->size() - 1];
     trackers->pop_back();
@@ -227,7 +222,7 @@ bool PerfMonitor::configure(SnortConfig* sc)
     new PerfRotateHandler(*this, sc);
 
     if ( config->perf_flags & PERF_FLOWIP )
-        flow_ip_handler = new FlowIPDataHandler(*this, sc);
+        new FlowIPDataHandler(*this, sc);
 
     return config->resolve();
 }