diff --git a/Adapter.cc b/Adapter.cc index 74f3a54..41c4004 100644 --- a/Adapter.cc +++ b/Adapter.cc @@ -51,8 +51,11 @@ namespace pEp { return 1; } if (ev == nullptr) { - if (_sync_thread) + if (_sync_thread) { _sync_thread->join(); + delete _sync_thread; + _sync_thread = nullptr; + } q.clear(); } return 0; @@ -111,8 +114,6 @@ namespace pEp { { if (_sync_thread) { _inject_sync_event(nullptr, nullptr); - delete _sync_thread; - _sync_thread = nullptr; } session(release); }