Wait: wait without callback, otherwise there will be use-after-dtor.
Signed-off-by: Tao He <sighingnow@gmail.com>
This commit is contained in:
parent
b3ce183889
commit
7b16ce6770
|
|
@ -107,7 +107,7 @@ void etcd::Watcher::Wait(std::function<void(bool)> callback)
|
||||||
currentTask.then([this, callback](pplx::task<void> const & resp_task) {
|
currentTask.then([this, callback](pplx::task<void> const & resp_task) {
|
||||||
resp_task.wait();
|
resp_task.wait();
|
||||||
callback(this->stubs->call->Cancelled());
|
callback(this->stubs->call->Cancelled());
|
||||||
});
|
}).wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
void etcd::Watcher::Cancel()
|
void etcd::Watcher::Cancel()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue