0.5.0 and ItemListBase

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Turtle
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Tue Nov 08, 2005 22:36

0.5.0 and ItemListBase

Postby Turtle » Fri May 19, 2006 05:54

Hi lindquist,

Following up from the pms, when I put in your changes to resetList_impl I found that when I populated the list, did a resetList on it, and then repopulated the list once more with ItemEntrys that have the same name, then I'd get the error message:

A Window object with the name 'Blah' already exists within the system


I did a quick check of the new section:

Code: Select all

      while (!d_listItems.empty())
      {
         d_pane->removeChildWindow(d_listItems[0]);
         if (d_listItems[0]->isDestroyedByParent())
         {
            WindowManager::getSingleton().destroyWindow(d_listItems[0]);
         }
      }


And it appears that both the removeChildWindow and the destroyWindow result in the d_listItems vector dropping an ItemEntry so two are lost each loop, but one is removed as a Child window and not destroyed, while the second one is destroyed but not removed as a Child window.

I tried the following code and it seems to work without this problem:

Code: Select all

      while (!d_listItems.empty())
      {
         ItemEntry* entry = d_listItems[0];
         d_pane->removeChildWindow(entry);
         if (entry->isDestroyedByParent())
         {
            WindowManager::getSingleton().destroyWindow(entry);
         }
      }


I have to admit that I've only given it a quick test however.

Cheers.
:D

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Fri May 19, 2006 14:06

You are right, the fix in PMd you was broken too :P
I fixed it just like you propose and it is in svn trunk already.

User avatar
Turtle
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Tue Nov 08, 2005 22:36

Postby Turtle » Sat May 20, 2006 09:29

Thanks lindquist.

:)


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 4 guests