nvnflinger: release queued handles immediately on disconnection

This commit is contained in:
Liam
2022-10-26 21:35:19 -04:00
parent cdb9fe978f
commit 2cdfbbc07d
4 changed files with 17 additions and 6 deletions

View File

@@ -742,6 +742,13 @@ Status BufferQueueProducer::Disconnect(NativeWindowApi api) {
return Status::NoError;
}
// HACK: We are not Android. Remove handle for items in queue, and clear queue.
// Allows synchronous destruction of nvmap handles.
for (auto& item : core->queue) {
nvmap.FreeHandle(item.graphic_buffer->BufferId(), true);
}
core->queue.clear();
switch (api) {
case NativeWindowApi::Egl:
case NativeWindowApi::Cpu: