Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2a13c3a

Browse files
authored
Added assert for host buffer allocation. (#55395)
fixes flutter/flutter#155555 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent dc44f95 commit 2a13c3a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

impeller/core/host_buffer.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ HostBuffer::HostBuffer(const std::shared_ptr<Allocator>& allocator)
2929
desc.size = kAllocatorBlockSize;
3030
desc.storage_mode = StorageMode::kHostVisible;
3131
for (auto i = 0u; i < kHostBufferArenaSize; i++) {
32-
device_buffers_[i].push_back(allocator->CreateBuffer(desc));
32+
std::shared_ptr<DeviceBuffer> device_buffer = allocator->CreateBuffer(desc);
33+
FML_CHECK(device_buffer) << "Failed to allocate device buffer.";
34+
device_buffers_[i].push_back(device_buffer);
3335
}
3436
}
3537

0 commit comments

Comments
 (0)