WindowManager::loadWindowLayout incorrect overload invoked

Create issue
Issue #236 resolved
Paul Turner created an issue

When using WindowManager::loadWindowLayout with a C string string literal passed as the name_prefix, the incorrect overload of loadWindowLayout may be invoked, causing instead the use of a randomly generated prefix.

Reproducibility: always

Steps to reproduce: This code will cause an unknown object exception: Window* sheet = winMgr.loadWindowLayout("Demo7Windows.layout", "test"); Window* wnd = sheet->getChild("testDemo7/Window1");

The window actually being named "0_Demo7/Window1"

Note that this code (explicitly using CEGUI::String) avoids the issue, so no exception is thrown: Window* sheet = winMgr.loadWindowLayout("Demo7Windows.layout", String("test")); Window* wnd = sheet->getChild("testDemo7/Window1");

Additional information: Since it has become common usage to use C style string literals with CEGUI function calls, it should be acceptable to assume that the use of them in this instance would not cause the issue that it does.

Any fix for this will require API changes of one form or another, so the fix will have to be done in trunk. A note in the docs will be added for branches/v0-6 to draw attention to the possible issue.

Comments (2)

  1. Paul Turner reporter

    This was fixed by removing the hacking that introduced the issue in the first place. trunk @ 2037.

  2. Log in to comment