mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 03:06:29 +00:00
Delete empty IGUIObject::Destroy function and MEGA TODO from 5122b0f906, e21ebb37f5.
None of the GUI object types implemented in the past two decades owns children, only the CGUI page. Differential Revision: https://code.wildfiregames.com/D2311 Tested on: clang 8.0.1, Jenkins This was SVN commit r22943.
This commit is contained in:
+5
-28
@@ -296,7 +296,11 @@ CGUI::CGUI(const shared_ptr<ScriptRuntime>& runtime)
|
||||
|
||||
CGUI::~CGUI()
|
||||
{
|
||||
Destroy();
|
||||
for (const std::pair<CStr, IGUIObject*>& p : m_pAllObjects)
|
||||
delete p.second;
|
||||
|
||||
for (const std::pair<CStr, const CGUISprite*>& p : m_Sprites)
|
||||
delete p.second;
|
||||
}
|
||||
|
||||
IGUIObject* CGUI::ConstructObject(const CStr& str)
|
||||
@@ -357,33 +361,6 @@ void CGUI::DrawSprite(const CGUISpriteInstance& Sprite, int CellID, const float&
|
||||
Sprite.Draw(*this, Rect, CellID, m_Sprites, Z);
|
||||
}
|
||||
|
||||
void CGUI::Destroy()
|
||||
{
|
||||
// We can use the map to delete all
|
||||
// now we don't want to cancel all if one Destroy fails
|
||||
for (const std::pair<CStr, IGUIObject*>& p : m_pAllObjects)
|
||||
{
|
||||
try
|
||||
{
|
||||
p.second->Destroy();
|
||||
}
|
||||
catch (PSERROR_GUI& e)
|
||||
{
|
||||
UNUSED2(e);
|
||||
debug_warn(L"CGUI::Destroy error");
|
||||
// TODO Gee: Handle
|
||||
}
|
||||
|
||||
delete p.second;
|
||||
}
|
||||
m_pAllObjects.clear();
|
||||
|
||||
for (const std::pair<CStr, const CGUISprite*>& p : m_Sprites)
|
||||
delete p.second;
|
||||
m_Sprites.clear();
|
||||
m_Icons.clear();
|
||||
}
|
||||
|
||||
void CGUI::UpdateResolution()
|
||||
{
|
||||
// Update ALL cached
|
||||
|
||||
Reference in New Issue
Block a user