From 6fe0f96ee7547073b55cd969ca5221528dee62aa Mon Sep 17 00:00:00 2001 From: heck Date: Sat, 27 Mar 2021 01:45:50 +0100 Subject: [PATCH] Adapter.hxx: session needs to be re-initialized here. To make sure that the session of the main thread and the session ot the sync thread have the same messageToSend, _inject_sync_event, _ensure_passphrase callbacks registered --- src/Adapter.hxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Adapter.hxx b/src/Adapter.hxx index c542032..f2050ba 100644 --- a/src/Adapter.hxx +++ b/src/Adapter.hxx @@ -96,7 +96,7 @@ namespace pEp { /* * Sync Thread Startup - * 1. ensure session for the main thread (registers: messageToSend, _inject_sync_event, _ensure_passphrase) + * 1. re-initialize session for the main thread (registers: messageToSend, _inject_sync_event, _ensure_passphrase) * 2. Start the sync thread * 3. Defer execution until sync thread register_sync_callbacks() has returned * 4. Throw pending exception from the sync thread @@ -118,8 +118,9 @@ namespace pEp { _notifyHandshake = notifyHandshake; } pEpLog("ensure session for the main thread"); - // 1. ensure session for the main thread (registers: messageToSend, _inject_sync_event, _ensure_passphrase) - session(); + // 1. re-initialize session for the main thread (registers: messageToSend, _inject_sync_event, _ensure_passphrase) + session(release); + session(init); if (!_sync_thread.joinable()) { register_done.store(false);