Skip to content

Commit b59f414

Browse files
committed
Small improvement for CGUI_Impl::DestroyElementRecursive
1 parent 62d4a53 commit b59f414

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Client/gui/CGUI_Impl.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ void CGUI_Impl::DestroyElementRecursive(CGUIElement* pElement)
2323

2424
if (auto* pImpl = dynamic_cast<CGUIElement_Impl*>(pElement))
2525
{
26-
DestroyGuiWindowRecursive(pImpl->GetWindow());
26+
CEGUI::Window* pWindow = pImpl->GetWindow();
27+
if (pWindow)
28+
DestroyGuiWindowRecursive(pWindow);
29+
else
30+
delete pElement;
2731
return;
2832
}
2933

0 commit comments

Comments
 (0)