diff --git a/ggml/src/ggml-metal/ggml-metal-device.m b/ggml/src/ggml-metal/ggml-metal-device.m index 9c07ff6e51..8a74550d15 100644 --- a/ggml/src/ggml-metal/ggml-metal-device.m +++ b/ggml/src/ggml-metal/ggml-metal-device.m @@ -2379,6 +2379,8 @@ void ggml_metal_buffer_set_tensor(ggml_metal_buffer_t buf, struct ggml_tensor * dispatch_release(completion_semaphore); //[cmd_buf waitUntilCompleted]; + + [buf_src release]; } } @@ -2417,6 +2419,8 @@ void ggml_metal_buffer_get_tensor(ggml_metal_buffer_t buf, const struct ggml_ten [cmd_buf commit]; [cmd_buf waitUntilCompleted]; + + [buf_dst release]; } }