mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
various cleanups and fixes
basicClouds refactored null dereference fixes in guiMenuBar
This commit is contained in:
parent
eb746a1142
commit
4d980e5406
6 changed files with 104 additions and 32 deletions
|
|
@ -515,10 +515,22 @@ void GuiMenuBar::processTick()
|
|||
|
||||
void GuiMenuBar::insert(SimObject* pObject, S32 pos)
|
||||
{
|
||||
PopupMenu* menu = dynamic_cast<PopupMenu*>(pObject);
|
||||
PopupMenu* menu = nullptr;
|
||||
if (pObject != nullptr)
|
||||
{
|
||||
menu = dynamic_cast<PopupMenu*>(pObject);
|
||||
}
|
||||
|
||||
if (menu == nullptr)
|
||||
{
|
||||
Con::errorf("GuiMenuBar::insert() - attempted to insert non-popupMenu object: %d", pObject->getId());
|
||||
if (pObject != nullptr)
|
||||
{
|
||||
Con::errorf("GuiMenuBar::insert() - attempted to insert non-popupMenu object: %d", pObject->getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
Con::errorf("GuiMenuBar::insert() - attempted to insert a nullptr object.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -541,10 +553,22 @@ void GuiMenuBar::insert(SimObject* pObject, S32 pos)
|
|||
|
||||
void GuiMenuBar::remove(SimObject* pObject)
|
||||
{
|
||||
PopupMenu* menu = dynamic_cast<PopupMenu*>(pObject);
|
||||
PopupMenu* menu = nullptr;
|
||||
if (pObject != nullptr)
|
||||
{
|
||||
menu = dynamic_cast<PopupMenu*>(pObject);
|
||||
}
|
||||
|
||||
if (menu == nullptr)
|
||||
{
|
||||
Con::errorf("GuiMenuBar::remove() - attempted to remove non-popupMenu object: %d", pObject->getId());
|
||||
if (pObject != nullptr)
|
||||
{
|
||||
Con::errorf("GuiMenuBar::insert() - attempted to insert non-popupMenu object: %d", pObject->getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
Con::errorf("GuiMenuBar::insert() - attempted to insert a nullptr object.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue