client: Handle orphaned Operations
Allow Operation instances to outlive the Context through which they were created.
This commit is contained in:
1 parent
5f421ce46b
commit
33b6f362db
11 files changed
+88
-13
No files matched your search
@@ -201,6 +201,17 @@ struct Tester {
|
||||
testEq(result["query.a"].as<int32_t>(), 5);
|
||||
testEq(result["query.b"].as<std::string>(), "hello");
|
||||
}
|
||||
|
||||
void orphan()
|
||||
{
|
||||
testShow()<<__func__;
|
||||
|
||||
auto op = cli.rpc("nonexistent").exec();
|
||||
|
||||
// clear Context to orphan in-progress operation
|
||||
cli = client::Context();
|
||||
op.reset();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@@ -216,6 +227,7 @@ MAIN(testrpc)
|
||||
Tester().cancel();
|
||||
Tester().error();
|
||||
Tester().builder();
|
||||
Tester().orphan();
|
||||
cleanup_for_valgrind();
|
||||
return testDone();
|
||||
}
|
||||
Reference in new issue
Block a user