I'm doing the following and getting that debug error:
AguiWidgetBase* AguiWidgetContainer::recursiveGetWidgetUnderMouse(
AguiWidgetBase* root, const AguiMouseEventArgs &mouse)
{
AguiWidgetBase* currentNode = root;
bool foundsomething = true;
while(foundsomething)
{
foundsomething = false;
if(currentNode->getChildCntrolCount() > 0)
for (std::vector<AguiWidgetBase*>::const_reverse_iterator rit =
currentNode->getChildRBeginIterator();
rit < currentNode->getChildREndIterator(); ++rit)
{
if(!foundsomething)
if ((*rit)->intersectionWithPoint(mouse.getPosition()))
{
foundsomething = true;
currentNode = *rit;
}
}
}
return currentNode;
}
// ...
It fails after currentNode becomes a pointer to a child of root, and crashes on the for.
What am I doing wrong?
Thanks