[Yunq] Release server cap on destructor.
This commit is contained in:
parent
43d7bfa7ad
commit
96a2f74e14
14 changed files with 123 additions and 8 deletions
|
|
@ -29,6 +29,12 @@ void YellowstoneServerBaseThreadBootstrap(void* server_base) {
|
|||
((YellowstoneServerBase*)server_base)->ServerThread();
|
||||
}
|
||||
|
||||
YellowstoneServerBase::~YellowstoneServerBase() {
|
||||
if (endpoint_ != 0) {
|
||||
check(ZCapRelease(endpoint_));
|
||||
}
|
||||
}
|
||||
|
||||
glcr::ErrorOr<YellowstoneClient> YellowstoneServerBase::CreateClient() {
|
||||
uint64_t client_cap;
|
||||
RET_ERR(ZCapDuplicate(endpoint_, ~(kZionPerm_Read), &client_cap));
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class YellowstoneServerBase {
|
|||
YellowstoneServerBase(z_cap_t Yellowstone_cap) : endpoint_(Yellowstone_cap) {}
|
||||
YellowstoneServerBase(const YellowstoneServerBase&) = delete;
|
||||
YellowstoneServerBase(YellowstoneServerBase&&) = delete;
|
||||
virtual ~YellowstoneServerBase();
|
||||
|
||||
glcr::ErrorOr<YellowstoneClient> CreateClient();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue