Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions impeller/renderer/backend/vulkan/command_encoder_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class TrackedObjectsVK {
if (!pool) {
VALIDATION_LOG
<< "Command pool died before a command buffer could be recycled.";
// The buffer can not be freed if its command pool has been destroyed.
buffer_.release();
return;
}
pool->CollectGraphicsCommandBuffer(std::move(buffer_));
Expand Down
5 changes: 5 additions & 0 deletions impeller/renderer/backend/vulkan/command_pool_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ vk::UniqueCommandBuffer CommandPoolVK::CreateGraphicsCommandBuffer() {
void CommandPoolVK::CollectGraphicsCommandBuffer(
vk::UniqueCommandBuffer buffer) {
Lock lock(buffers_to_collect_mutex_);
if (!graphics_pool_) {
// If the command pool has already been destroyed, then its command buffers
// have been freed and are now invalid.
buffer.release();
}
buffers_to_collect_.insert(MakeSharedVK(std::move(buffer)));
GarbageCollectBuffersIfAble();
}
Expand Down