From 05c66d5a742feb4f48d39f344d59d80c138950f9 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Mon, 22 Oct 2018 19:54:33 +0200 Subject: [PATCH] moving startup code before register_sync_callbacks() --- Adapter.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Adapter.hxx b/Adapter.hxx index 903be07..3fb539b 100644 --- a/Adapter.hxx +++ b/Adapter.hxx @@ -17,13 +17,13 @@ namespace pEp { template< class T > void sync_thread(T *obj, function< void(T *) > _startup, function< void(T *) > _shutdown) { + if (obj && _startup) + _startup(obj); + PEP_STATUS status = register_sync_callbacks(session(), nullptr, _notifyHandshake, _retrieve_next_sync_event); throw_status(status); - if (obj && _startup) - _startup(obj); - do_sync_protocol(session(), (void *)obj); unregister_sync_callbacks(session());