Bugfix: IGUIElement::addChild now prevents setting an element as it's own child (fixes for example a crash in the GUI-editor).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4694 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2014-02-18 12:02:22 +00:00
parent d697587211
commit ee19b6b5e8
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- Bugfix: IGUIElement::addChild now prevents setting an element as it's own child.
- Bugfix: getFont for xml-fonts now also works for fonts inside archives (thx @Neirdan for bugreport) - Bugfix: getFont for xml-fonts now also works for fonts inside archives (thx @Neirdan for bugreport)
- Added function irr::core::mergeFilename - Added function irr::core::mergeFilename
- Add ISceneNodeAnimator::setStartTime/getStartTime to allow resetting movement animators. - Add ISceneNodeAnimator::setStartTime/getStartTime to allow resetting movement animators.

View File

@ -278,9 +278,9 @@ public:
//! Adds a GUI element as new child of this element. //! Adds a GUI element as new child of this element.
virtual void addChild(IGUIElement* child) virtual void addChild(IGUIElement* child)
{ {
addChildToEnd(child); if ( child && child != this )
if (child)
{ {
addChildToEnd(child);
child->updateAbsolutePosition(); child->updateAbsolutePosition();
} }
} }