face: making Face::shutdown call asynchronous
After Face::processInterestFilters changed to dispatch all callbacks
that match the configured filters, calling shutdown() from inside the
callback caused segfault (unexpected invalidation of the iterator).
Change-Id: Ia0a3048ce3574d354071e091c2d9400ad9a263b4
Refs: #1366
diff --git a/src/face.cpp b/src/face.cpp
index aec1cdf..fa0f24d 100644
--- a/src/face.cpp
+++ b/src/face.cpp
@@ -261,6 +261,12 @@
void
Face::shutdown()
{
+ m_ioService->post(bind(&Face::asyncShutdown, this));
+}
+
+void
+Face::asyncShutdown()
+{
m_pendingInterestTable.clear();
m_registeredPrefixTable.clear();