rocr: make sure the member variable is conctructed (#1387)

Signed-off-by: Alex Xie <AlexBin.Xie@amd.com>
This commit is contained in:
Xie, AlexBin
2025-11-05 17:19:33 -05:00
کامیت شده توسط GitHub
والد a330fb6b91
کامیت c877be2afe
@@ -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;
}