diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index a80d17af16..08842cb75e 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -496,6 +496,9 @@ void GpuAgent::InitScratchPool() { if (!core::Runtime::runtime_singleton_->flag().enable_scratch()) { scratch_pool_. ~SmallHeap(); + + // Reconstruct the object as default to allow ~GpuAgent to destruct the member variable + new (&scratch_pool_) SmallHeap(); return; }