Commit 7d422ca9 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Close BufferCollection on SysmemBufferPool destruction

Previously SysmemBufferPool wasn't calling Close(), which means that
sysmem would fail the collection after SysmemBufferPool is destroyed,
which prevent other clients from using that collection. Now the
destructor calls Close() to avoid this issue.

Change-Id: I0edd5cf9c79d9c0a14048211cebab215d76c953c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1820102
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699900}
parent f6fd1216
...@@ -63,7 +63,10 @@ SysmemBufferPool::SysmemBufferPool( ...@@ -63,7 +63,10 @@ SysmemBufferPool::SysmemBufferPool(
}); });
} }
SysmemBufferPool::~SysmemBufferPool() = default; SysmemBufferPool::~SysmemBufferPool() {
if (collection_)
collection_->Close();
}
fuchsia::sysmem::BufferCollectionTokenPtr SysmemBufferPool::TakeToken() { fuchsia::sysmem::BufferCollectionTokenPtr SysmemBufferPool::TakeToken() {
DCHECK(!shared_tokens_.empty()); DCHECK(!shared_tokens_.empty());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment