Skip to content
Snippets Groups Projects
Commit 45d9654f authored by Sébastien Blin's avatar Sébastien Blin
Browse files

conversation: pass shared_ptr to asio tasks

Else, destruction of the object can occurs during a async task
causing weird crashes.

Change-Id: Ia5f7e8f7324a8e8708c94890627d8576538289d3
parent e995af74
Branches
No related tags found
No related merge requests found
...@@ -1842,7 +1842,7 @@ Conversation::checkBootstrapMember(const asio::error_code& ec, ...@@ -1842,7 +1842,7 @@ Conversation::checkBootstrapMember(const asio::error_code& ec,
sthis->pimpl_->fallbackTimer_->expires_at(std::chrono::steady_clock::now()); sthis->pimpl_->fallbackTimer_->expires_at(std::chrono::steady_clock::now());
sthis->pimpl_->fallbackTimer_->async_wait( sthis->pimpl_->fallbackTimer_->async_wait(
std::bind(&Conversation::checkBootstrapMember, std::bind(&Conversation::checkBootstrapMember,
sthis.get(), sthis,
std::placeholders::_1, std::placeholders::_1,
std::move(members))); std::move(members)));
} }
...@@ -1904,7 +1904,7 @@ Conversation::bootstrap(std::function<void()> onBootstraped) ...@@ -1904,7 +1904,7 @@ Conversation::bootstrap(std::function<void()> onBootstraped)
sthis->pimpl_->fallbackTimer_->expires_at(std::chrono::steady_clock::now() + 20s sthis->pimpl_->fallbackTimer_->expires_at(std::chrono::steady_clock::now() + 20s
- std::chrono::seconds(timeForBootstrap)); - std::chrono::seconds(timeForBootstrap));
sthis->pimpl_->fallbackTimer_->async_wait(std::bind(&Conversation::checkBootstrapMember, sthis->pimpl_->fallbackTimer_->async_wait(std::bind(&Conversation::checkBootstrapMember,
sthis.get(), sthis,
std::placeholders::_1, std::placeholders::_1,
std::move(members))); std::move(members)));
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment