src: destruct logic and socket properly

Change-Id: Iedd14dcd7cb9567d549513e6fee3a18dd45f1d83
diff --git a/src/logic.cpp b/src/logic.cpp
index 48d6cfb..25f2abb 100644
--- a/src/logic.cpp
+++ b/src/logic.cpp
@@ -116,8 +116,9 @@
 
 Logic::~Logic()
 {
-  m_face.unsetInterestFilter(m_syncRegisteredPrefixId);
   m_scheduler.cancelAllEvents();
+  m_interestTable.clear();
+  m_face.shutdown();
 }
 
 void
diff --git a/src/logic.hpp b/src/logic.hpp
index b7bfbdf..d4a811f 100644
--- a/src/logic.hpp
+++ b/src/logic.hpp
@@ -101,6 +101,7 @@
   /**
    * @brief Constructor
    *
+   * @param face The face used to communication, will be shutdown in destructor
    * @param syncPrefix The prefix of the sync group
    * @param defaultUserPrefix The prefix of the first user added to this session
    * @param onUpdate The callback function to handle state updates
diff --git a/src/socket.hpp b/src/socket.hpp
index 450dfeb..d213018 100644
--- a/src/socket.hpp
+++ b/src/socket.hpp
@@ -192,7 +192,6 @@
 
   Name m_userPrefix;
   ndn::Face& m_face;
-
   Logic m_logic;
 
   ndn::Name m_signingId;