Fix memory leak while doing drag&drop with Debug Draw in use

#1723
This commit is contained in:
Wojtek Figat
2023-11-06 17:18:20 +01:00
parent e7b1fce3eb
commit ae85a94261
2 changed files with 19 additions and 0 deletions

View File

@@ -696,12 +696,15 @@ void* DebugDraw::AllocateContext()
void DebugDraw::FreeContext(void* context)
{
ASSERT(context);
Memory::DestructItem((DebugDrawContext*)context);
Allocator::Free(context);
}
void DebugDraw::UpdateContext(void* context, float deltaTime)
{
if (!context)
context = &GlobalContext;
((DebugDrawContext*)context)->DebugDrawDefault.Update(deltaTime);
((DebugDrawContext*)context)->DebugDrawDepthTest.Update(deltaTime);
}