client: Handle orphaned Operations

Allow Operation instances to outlive
the Context through which they were
created.
This commit is contained in:
Michael Davidsaver
2020-07-27 11:41:07 -07:00
parent 5f421ce46b
commit 33b6f362db
11 changed files with 88 additions and 13 deletions
+3 -2
View File
@@ -412,10 +412,11 @@ void Context::Pvt::close()
conns.clear();
chans.clear();
assert(internal_self.use_count()==1);
// internal_self.use_count() may be >1 if
// we are orphaning some Operations
});
tcp_loop.join();
tcp_loop.sync();
// ensure any in-progress callbacks have completed
manager.sync();