Okay, thanks for the update. This new informations is actually super-useful. I have a suspicion of what this might be, but I'll not say more until I have checked.
I'll definately do this today, so expect a full report later on
CE.
MultiColumnList::setItem problem in release mode
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: MultiColumnList::setItem problem in release mode
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: MultiColumnList::setItem problem in release mode
I've done some checking, and was able to reproduce the issue, getting the odd return values as described. Since the only code in that whole section is STL calls, and the problem only happens with optimisations on, I can only conclude that some part of the code is being affected by one or more of the VC++ optimisation bugs.
To work around this issue, I have split the component parts of the line out into seperate lines.
Please try the following patch, and let me know how it goes.
Thanks,
CE.
To work around this issue, I have split the component parts of the line out into seperate lines.
Please try the following patch, and let me know how it goes.
Code: Select all
Index: src/elements/CEGUIMultiColumnList.cpp
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/src/elements/CEGUIMultiColumnList.cpp,v
retrieving revision 1.21
diff -u -r1.21 CEGUIMultiColumnList.cpp
--- src/elements/CEGUIMultiColumnList.cpp 27 Feb 2005 14:21:22 -0000 1.21
+++ src/elements/CEGUIMultiColumnList.cpp 11 Mar 2005 13:25:59 -0000
@@ -809,8 +809,12 @@
// if sorting is enabled, insert at an appropriate position
if (getSortDirection() != ListHeaderSegment::None)
{
- // insert item and get insert position index.
- pos = (uint)std::distance(d_grid.begin(), d_grid.insert(std::upper_bound(d_grid.begin(), d_grid.end(), row), row));
+ // calculate where the row should be inserted
+ ListItemGrid::iterator ins_pos = std::upper_bound(d_grid.begin(), d_grid.end(), row);
+ // insert item and get final inserted position.
+ ListItemGrid::iterator final_pos = d_grid.insert(ins_pos, row);
+ // get final inserted position as an uint.
+ pos = (uint)std::distance(d_grid.begin(), final_pos);
}
// not sorted, just stick it on the end.
else
Thanks,
CE.
Re: MultiColumnList::setItem problem in release mode
Yes it was an "over-optimisation" from visual c++. The patch works great (better than my simply turning off the optimisation for the hole function...).
Thanks a lot! You are so quick...
mac
Thanks a lot! You are so quick...
mac
- spannerman
- Home away from home
- Posts: 330
- Joined: Wed Jan 12, 2005 12:06
Re: MultiColumnList::setItem problem in release mode
Yes, thanks Eddie. Sorry I wasnt so helpful in the end with this...but I guess its all part of my learning how to debug properly
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: MultiColumnList::setItem problem in release mode
spannerman wrote:
Yes, thanks Eddie. Sorry I wasnt so helpful in the end with this...but I guess its all part of my learning how to debug properly
Hey, no problem. It's great that you came across this in the first place, since it's pretty obscure and could have gone unnoticed for much longer than what it did.
The fix is now in CVS.
CE.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 5 guests