Windows Update
Posted: Fri Nov 10, 2006 15:28
Hi,
I am currently using CEGUI v0.4.1 and I stumble across a problem, then I checked the source code from v0.5 and it is still there so I just wanted to share my experience thus preventing some pain for CEGUI Users.
The window::update code looks like this :
The problem is there is one case where a update can kill a window, it is if you use Tooltip. In that case if the tooltip is displayed and something make it disappear it will execute this code (in Tooltip::switchToInactivateWindowState ):
So the tooltip remove itself from the window and the update loop of the window can simply crash as it tries to access an out of bound element.
I simply reverse counted the update loop going from childCount - 1 to 0 and then it works.
Stéphane[/code][/quote]
I am currently using CEGUI v0.4.1 and I stumble across a problem, then I checked the source code from v0.5 and it is still there so I just wanted to share my experience thus preventing some pain for CEGUI Users.
The window::update code looks like this :
Code: Select all
// update child windows
size_t child_count = getChildCount();
for (size_t i = 0; i < child_count; ++i)
{
d_children[i]->update(elapsed);
}
The problem is there is one case where a update can kill a window, it is if you use Tooltip. In that case if the tooltip is displayed and something make it disappear it will execute this code (in Tooltip::switchToInactivateWindowState ):
Code: Select all
if (d_parent)
d_parent->removeChildWindow(this);
So the tooltip remove itself from the window and the update loop of the window can simply crash as it tries to access an out of bound element.
I simply reverse counted the update loop going from childCount - 1 to 0 and then it works.
Stéphane[/code][/quote]