Skip to content

Commit

Permalink
fix client close
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed Jan 20, 2024
1 parent 50eae79 commit 3822441
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/rest_rpc/rpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ class rpc_client : private asio::noncopyable {
}

~rpc_client() {
close();
std::promise<void> promise;
ios_.post([this, &promise] {
close();
promise.set_value();
});
promise.get_future().wait();
stop();
}

Expand Down

0 comments on commit 3822441

Please sign in to comment.