diff --git a/src/Host.cpp b/src/Host.cpp index 9e0c42d8e7..85be6fe804 100644 --- a/src/Host.cpp +++ b/src/Host.cpp @@ -49,7 +49,7 @@ Host::Host(NetworkInterface *_iface, Mac *_mac, Host::~Host() { if(num_uses > 0 && (!iface->isView() - || !ntop->getGlobals()->isShutdown() /* View hosts are not in sync with viewed flows so during shutdown it can be normal */)) + || !ntop->getGlobals()->isShutdownRequested()/* View hosts are not in sync with viewed flows so during shutdown it can be normal */)) ntop->getTrace()->traceEvent(TRACE_WARNING, "Internal error: num_uses=%u", num_uses); // ntop->getTrace()->traceEvent(TRACE_NORMAL, "Deleting %s (%s)", k, localHost ? "local": "remote"); diff --git a/src/NetworkInterface.cpp b/src/NetworkInterface.cpp index 7547d68ffa..7d97fb7d10 100644 --- a/src/NetworkInterface.cpp +++ b/src/NetworkInterface.cpp @@ -99,7 +99,6 @@ NetworkInterface::NetworkInterface(const char *name, } } - db = NULL; ifname = strdup(name); if(custom_interface_type) { ifDescription = strdup(name); @@ -177,14 +176,14 @@ NetworkInterface::NetworkInterface(const char *name, arp_requests = arp_replies = 0; running = false, - inline_interface = false, db = NULL; + inline_interface = false; checkIdle(); ifSpeed = Utils::getMaxIfSpeed(name); ifMTU = Utils::getIfMTU(name), mtuWarningShown = false; reloadDhcpRanges(); } else /* id < 0 */ { - db = NULL, ifSpeed = 0; + ifSpeed = 0; } networkStats = NULL; @@ -6945,7 +6944,7 @@ bool NetworkInterface::initFlowDump(u_int8_t num_dump_interfaces) { if(isFlowDumpDisabled()) return(false); - if(!isView()) { + if(!isViewed()) { /* Flow dump is handled by the view interface in case of 'viewed' interfaces */ #if defined(NTOPNG_PRO) && defined(HAVE_NINDEX) if(ntop->getPrefs()->do_dump_flows_on_nindex()) { if(num_dump_interfaces + 1 >= NINDEX_MAX_NUM_INTERFACES) { diff --git a/src/Ntop.cpp b/src/Ntop.cpp index 3a4a1fb847..f180f4ffc6 100644 --- a/src/Ntop.cpp +++ b/src/Ntop.cpp @@ -175,19 +175,10 @@ Ntop::~Ntop() { if(httpd) delete httpd; /* Stop the http server before tearing down network interfaces */ - /* Views are deleted first as they require access to the underlying sub-interfaces */ - for(int i = 0; i < num_defined_interfaces; i++) { - if(iface[i] && iface[i]->isView()) { - iface[i]->shutdown(); - delete(iface[i]); - iface[i] = NULL; - } - } - for(int i = 0; i < num_defined_interfaces; i++) { if(iface[i]) { iface[i]->shutdown(); - delete(iface[i]); + delete iface[i]; iface[i] = NULL; } }