[Yunq] Release server cap on destructor.

This commit is contained in:
Drew Galbraith 2023-11-27 08:11:52 -08:00
parent 43d7bfa7ad
commit 96a2f74e14
14 changed files with 123 additions and 8 deletions

View file

@ -29,6 +29,12 @@ void {{interface.name}}ServerBaseThreadBootstrap(void* server_base) {
(({{interface.name}}ServerBase*)server_base)->ServerThread();
}
{{interface.name}}ServerBase::~{{interface.name}}ServerBase() {
if (endpoint_ != 0) {
check(ZCapRelease(endpoint_));
}
}
glcr::ErrorOr<{{interface.name}}Client> {{interface.name}}ServerBase::CreateClient() {
uint64_t client_cap;
RET_ERR(ZCapDuplicate(endpoint_, ~(kZionPerm_Read), &client_cap));