[Solved]Bug in Widget class

shenjoku

25-12-2011 01:12:00

There's a bug in Widget::_destroyChildWidget(). Instead of just doing:
mWidgetChild.erase(iter);
It's doing something weird, which is changing the order of the data in some cases:

*iter = mWidgetChild.back();
mWidgetChild.pop_back();


This is causing some issues since the order matters in a lot of cases.

Altren

25-12-2011 14:06:02

It is common optimisation, pop-back works much faster than erase. But I don't think that we actually need it there. We changed code back to common erase.

shenjoku

27-12-2011 20:38:43

Oh, I see. I've never seen it before so it was kind of surprising to me. Thanks for doing that :)