client cancel() w/ tryCall()

Fail soft if  worker thread has already stopped.
This commit is contained in:
Michael Davidsaver
2021-04-16 18:57:25 -07:00
parent 1e08b6faf0
commit 8555bb63ef
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -187,8 +187,8 @@ struct SubscriptionImpl : public OperationBase, public Subscription
virtual bool cancel() override final {
decltype (event) junk;
bool ret;
loop.call([this, &junk, &ret](){
bool ret = false;
(void)loop.tryCall([this, &junk, &ret](){
ret = _cancel(false);
junk = std::move(event);
// leave opByIOID for GC