File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,11 @@ class Context {
5050 Context (Context& parent);
5151 Context (Context& parent, std::chrono::milliseconds timeout_ms);
5252
53- Context *parent;
54- thread::Channel<bool > *ch;
53+ Context *parent = nullptr ;
54+ thread::Channel<bool > *ch = nullptr ;
5555 std::future<void > async_cb;
5656 std::chrono::milliseconds timeout_ms;
57- std::unique_ptr<std::stop_callback<std::function<void ()>>> cb;
57+ std::unique_ptr<std::stop_callback<std::function<void ()>>> cb = nullptr ;
5858
5959 friend Context& Background ();
6060 friend class WithCancel ;
Original file line number Diff line number Diff line change @@ -12,9 +12,6 @@ namespace mesh {
1212namespace context {
1313
1414Context::Context () : ss(std::stop_source()),
15- parent (nullptr ),
16- cb(nullptr ),
17- ch(nullptr ),
1815 timeout_ms (std::chrono::milliseconds(0 ))
1916{
2017}
@@ -55,7 +52,7 @@ Context& Context::operator=(Context&& other) noexcept {
5552 ss = std::stop_source ();
5653 parent = other.parent ;
5754
58- if (parent){
55+ if (parent) {
5956 cb = std::make_unique<std::stop_callback<std::function<void ()>>>(
6057 parent->ss .get_token (), [this ] { cancel (); }
6158 );
You can’t perform that action at this time.
0 commit comments