Skip to content

Commit 1c4e32b

Browse files
authored
Merge pull request #153 from fo-fo/leak-fix
Fix a memory leak in IntersectorShortStack.
2 parents 044e260 + 8d3b957 commit 1c4e32b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

RadeonRays/src/intersector/intersector_short_stack.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,11 @@ namespace RadeonRays
397397
m_gpudata->bvh = m_device->CreateBuffer(translator.nodes_.size() * sizeof(FatNodeBvhTranslator::Node), Calc::BufferType::kRead, &translator.nodes_[0]);
398398

399399
// Stack
400+
if (m_gpudata->stack)
401+
{
402+
m_device->DeleteBuffer(m_gpudata->stack);
403+
m_gpudata->stack = nullptr;
404+
}
400405
m_gpudata->stack = m_device->CreateBuffer(kMaxBatchSize*kMaxStackSize, Calc::BufferType::kWrite);
401406

402407
// Make sure everything is commited

0 commit comments

Comments
 (0)