Merge branch releases/1.8 revisions r5326:r5346 into trunk.

- Fix crash in eventhandling when calling remove() on a contextmenu while it has focus.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5347 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2016-10-28 10:17:35 +00:00
parent 28d2756b27
commit 5962caf6aa
2 changed files with 19 additions and 15 deletions

View File

@ -156,6 +156,7 @@ should now be fps independentn
-------------------------- --------------------------
Changes in 1.8.5 Changes in 1.8.5
- Fix crash in eventhandling when calling remove() on a contextmenu while it has focus.
- CImageLoaderJPG::isALoadableFileFormat uses a test which allows to load more jpg formats (for example uncompressed jpg's). Thx @Yaron Cohen-Tal for report, test-image and his help with the patch. - CImageLoaderJPG::isALoadableFileFormat uses a test which allows to load more jpg formats (for example uncompressed jpg's). Thx @Yaron Cohen-Tal for report, test-image and his help with the patch.
-------------------------- --------------------------
@ -251,7 +252,7 @@ Changes in 1.8 (7.11.2012)
- quaternion conversions to and from matrix4 no longer invert rotations. - quaternion conversions to and from matrix4 no longer invert rotations.
To test if your code was affected by this you can set IRR_TEST_BROKEN_QUATERNION_USE in quaternion.h and try to compile your application. To test if your code was affected by this you can set IRR_TEST_BROKEN_QUATERNION_USE in quaternion.h and try to compile your application.
Then on all compile-errors when you pass the matrix to the quaternion you can replace the matrix transposed matrix. Then on all compile-errors when you pass the matrix to the quaternion you can replace the matrix with the transposed matrix.
For all errors you get on getMatrix() you can use quaternion::getMatrix_transposed instead. For all errors you get on getMatrix() you can use quaternion::getMatrix_transposed instead.
- CGUIEnvironment::loadGui - loading a gui into a target-element no longer messes up when the gui-file contained guienvironment serialization. - CGUIEnvironment::loadGui - loading a gui into a target-element no longer messes up when the gui-file contained guienvironment serialization.

View File

@ -285,22 +285,25 @@ bool CGUIContextMenu::OnEvent(const SEvent& event)
{ {
// set event parent of submenus // set event parent of submenus
IGUIElement * p = EventParent ? EventParent : Parent; IGUIElement * p = EventParent ? EventParent : Parent;
setEventParent(p); if ( p ) // can be 0 when element got removed already
SEvent event;
event.EventType = EET_GUI_EVENT;
event.GUIEvent.Caller = this;
event.GUIEvent.Element = 0;
event.GUIEvent.EventType = EGET_ELEMENT_CLOSED;
if ( !p->OnEvent(event) )
{ {
if ( CloseHandling & ECMC_HIDE ) setEventParent(p);
SEvent event;
event.EventType = EET_GUI_EVENT;
event.GUIEvent.Caller = this;
event.GUIEvent.Element = 0;
event.GUIEvent.EventType = EGET_ELEMENT_CLOSED;
if ( !p->OnEvent(event) )
{ {
setVisible(false); if ( CloseHandling & ECMC_HIDE )
} {
if ( CloseHandling & ECMC_REMOVE ) setVisible(false);
{ }
remove(); if ( CloseHandling & ECMC_REMOVE )
{
remove();
}
} }
} }