face: fire onFail event on WebSocket and Ethernet face close
Change-Id: I3d24c7b2e5003253ff04dab68ec1a2cb37b7d023
Refs: #1637
diff --git a/daemon/face/ethernet-face.cpp b/daemon/face/ethernet-face.cpp
index 0abbfff..27d4968 100644
--- a/daemon/face/ethernet-face.cpp
+++ b/daemon/face/ethernet-face.cpp
@@ -82,6 +82,7 @@
EthernetFace::~EthernetFace()
{
+ onFail.clear(); // no reason to call onFail anymore
close();
}
@@ -108,6 +109,8 @@
m_socket->close(error); // ignore errors
pcap_close(m_pcap);
m_pcap = 0;
+
+ onFail("Face closed");
}
}