iface proper destructor

Inside iface::~iface(), make sure to close any open sockets
and restore ALLMULTI to it's original value.
This commit is contained in:
Daniel Adolfsson 2011-09-17 02:22:33 +02:00
parent 62edaf3c6b
commit 70933e0830

View File

@ -53,6 +53,15 @@ iface::iface() :
iface::~iface()
{
DBG("iface::~iface()");
if(_ifd >= 0)
close(_ifd);
if(_pfd >= 0)
{
allmulti(_prev_allmulti);
close(_pfd);
}
}
strong_ptr<iface> iface::open_pfd(const std::string& name)