Skip to content

Commit b0e5beb

Browse files
hexagon: don't forget to release buffer contexts
1 parent dda466c commit b0e5beb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ggml/src/ggml-hexagon/ggml-hexagon.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,9 @@ void ggml_hexagon_session::release() noexcept(true) {
16321632
}
16331633

16341634
ggml_hexagon_session::ggml_hexagon_session(int dev_id) noexcept(false) {
1635+
buffer_type.context = nullptr;
1636+
repack_buffer_type.context = nullptr;
1637+
16351638
try {
16361639
allocate(dev_id);
16371640

@@ -1648,6 +1651,9 @@ ggml_hexagon_session::ggml_hexagon_session(int dev_id) noexcept(false) {
16481651

16491652
ggml_hexagon_session::~ggml_hexagon_session() noexcept(true) {
16501653
release();
1654+
1655+
delete static_cast<ggml_backend_hexagon_buffer_type_context*>(buffer_type.context);
1656+
delete static_cast<ggml_backend_hexagon_buffer_type_context*>(repack_buffer_type.context);
16511657
}
16521658

16531659
// ** backend interface

0 commit comments

Comments
 (0)