src: destruct logic and socket properly
Change-Id: Iedd14dcd7cb9567d549513e6fee3a18dd45f1d83
This commit is contained in:
1 parent
53f5f041e8
commit
9d5679a6b0
5 files changed
+17
-16
No files matched your search
+11
-11
@@ -64,17 +64,17 @@ using std::size_t;
|
||||
using boost::noncopyable;
|
||||
using boost::scoped_ptr;
|
||||
|
||||
using ndn::shared_ptr;
|
||||
using ndn::weak_ptr;
|
||||
using ndn::enable_shared_from_this;
|
||||
using ndn::make_shared;
|
||||
using ndn::static_pointer_cast;
|
||||
using ndn::dynamic_pointer_cast;
|
||||
using ndn::const_pointer_cast;
|
||||
using ndn::function;
|
||||
using ndn::bind;
|
||||
using ndn::ref;
|
||||
using ndn::cref;
|
||||
using std::shared_ptr;
|
||||
using std::weak_ptr;
|
||||
using std::enable_shared_from_this;
|
||||
using std::make_shared;
|
||||
using std::static_pointer_cast;
|
||||
using std::dynamic_pointer_cast;
|
||||
using std::const_pointer_cast;
|
||||
using std::function;
|
||||
using std::bind;
|
||||
using std::ref;
|
||||
using std::cref;
|
||||
|
||||
using ndn::Interest;
|
||||
using ndn::Data;
|
||||
|
||||
+2
-1
@@ -116,8 +116,9 @@ Logic::Logic(ndn::Face& face,
|
||||
|
||||
Logic::~Logic()
|
||||
{
|
||||
m_face.unsetInterestFilter(m_syncRegisteredPrefixId);
|
||||
m_scheduler.cancelAllEvents();
|
||||
m_interestTable.clear();
|
||||
m_face.shutdown();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -101,6 +101,7 @@ public:
|
||||
/**
|
||||
* @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
|
||||
|
||||
@@ -192,7 +192,6 @@ private:
|
||||
|
||||
Name m_userPrefix;
|
||||
ndn::Face& m_face;
|
||||
|
||||
Logic m_logic;
|
||||
|
||||
ndn::Name m_signingId;
|
||||
|
||||
@@ -30,8 +30,8 @@ def configure(conf):
|
||||
|
||||
boost_libs = 'system iostreams'
|
||||
if conf.options._tests:
|
||||
conf.env['_TESTS'] = 1
|
||||
conf.define('_TESTS', 1);
|
||||
conf.env['CHRONOSYNC_HAVE_TESTS'] = 1
|
||||
conf.define('CHRONOSYNC_HAVE_TESTS', 1);
|
||||
boost_libs += ' unit_test_framework'
|
||||
|
||||
conf.check_boost(lib=boost_libs)
|
||||
@@ -54,7 +54,7 @@ def build(bld):
|
||||
)
|
||||
|
||||
# Unit tests
|
||||
if bld.env["_TESTS"]:
|
||||
if bld.env["CHRONOSYNC_HAVE_TESTS"]:
|
||||
bld.recurse('tests')
|
||||
|
||||
bld.install_files(
|
||||
|
||||
Reference in new issue
Block a user