TabControl::makeButtonName(Window* wnd) can potentially create colliding names

Create issue
Issue #383 resolved
Martin Preisler created an issue

String TabControl::makeButtonName(Window* wnd) creates names based on the name of given wnd.

Reproducibility: always

Additional information: If we pick 2 windows - "1/Collision" and "2/Collision" and add them to TabControl, CEGUI will crash because 2 buttons with same name "Collision" will be created.

I propose making this method generate names based on pointer to wnd. This should be unique in all situations and won't break any existing functionality.

Comments (1)

  1. Paul Turner

    Fixed in branches/v0-7 r2606.

    Went with a fix that appends the entire window name rather than just the last part of the name. This was preferred over the use of names based on window pointers to ensure that the buttons remain accessible (using WindowManager::getWindow and others) via known text based name construction, since that is not possible using memory address based names.

  2. Log in to comment