diff --git a/osdep/LinuxEthernetTap.cpp b/osdep/LinuxEthernetTap.cpp index 8a557c077..d75fcdf97 100644 --- a/osdep/LinuxEthernetTap.cpp +++ b/osdep/LinuxEthernetTap.cpp @@ -327,14 +327,14 @@ LinuxEthernetTap::~LinuxEthernetTap() (void)::write(_shutdownSignalPipe[1],"\0",1); // causes reader thread(s) to exit _tapq.post(std::pair(nullptr,0)); // causes processor thread to exit - ::close(_fd); - ::close(_shutdownSignalPipe[0]); - ::close(_shutdownSignalPipe[1]); - _tapReaderThread[0].join(); _tapReaderThread[1].join(); _tapProcessorThread.join(); + ::close(_fd); + ::close(_shutdownSignalPipe[0]); + ::close(_shutdownSignalPipe[1]); + for(std::vector::iterator i(_buffers.begin());i!=_buffers.end();++i) free(*i); std::vector< std::pair > dv(_tapq.drain());