From c59a9b32535240936f1872e6ac05ab48cd6982cf Mon Sep 17 00:00:00 2001 From: Aidan Belton-Schure Date: Wed, 25 Sep 2024 09:20:14 +0000 Subject: [PATCH] SWDEV-485827 release initial_heap_buffer_ This PR adds the initialization and release of initial_heap_buffer_ to prevent memory leaks. Change-Id: I4ab8721b439a1a3a6f6e53d63d870e572f7c984a [ROCm/clr commit: f42a87dc2f6141b845e43d61d20f7d925ed8a386] --- projects/clr/rocclr/device/device.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/clr/rocclr/device/device.cpp b/projects/clr/rocclr/device/device.cpp index d090516013..cb96df25b0 100644 --- a/projects/clr/rocclr/device/device.cpp +++ b/projects/clr/rocclr/device/device.cpp @@ -649,6 +649,7 @@ Device::Device() blitProgram_(nullptr), context_(nullptr), heap_buffer_(nullptr), + initial_heap_buffer_(nullptr), arena_mem_obj_(nullptr), vaCacheAccess_(nullptr), vaCacheMap_(nullptr), @@ -662,6 +663,11 @@ Device::~Device() { heap_buffer_ = nullptr; } + if (initial_heap_buffer_ != nullptr) { + delete initial_heap_buffer_; + initial_heap_buffer_ = nullptr; + } + if (arena_mem_obj_ != nullptr) { arena_mem_obj_->release(); }