vulkan : initialize vk_buffer_struct members to VK_NULL_HANDLE (ggml/893)
This prevents invalid frees when destroying a partially initialized vk_buffer_struct. For example, this could happen in ggml_vk_create_buffer when running out of device memory. Co-authored-by: Tony Wasserka <neobrain@users.noreply.github.com>
This commit is contained in:
parent
d2b851bfa1
commit
203b7f1531
1 changed files with 2 additions and 2 deletions
|
@ -236,8 +236,8 @@ struct vk_device_struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vk_buffer_struct {
|
struct vk_buffer_struct {
|
||||||
vk::Buffer buffer;
|
vk::Buffer buffer = VK_NULL_HANDLE;
|
||||||
vk::DeviceMemory device_memory;
|
vk::DeviceMemory device_memory = VK_NULL_HANDLE;
|
||||||
vk::MemoryPropertyFlags memory_property_flags;
|
vk::MemoryPropertyFlags memory_property_flags;
|
||||||
void * ptr;
|
void * ptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue