mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Allow changing element root widget type, prevent use after free in script settings
This commit is contained in:
parent
64df4f54c6
commit
a972a54ea9
6 changed files with 73 additions and 26 deletions
|
@ -26,12 +26,9 @@ namespace LuaUi
|
|||
allSettings.clear();
|
||||
}
|
||||
|
||||
void attachToWidget(const ScriptSettings& script, MyGUI::Widget* widget)
|
||||
void attachToWidget(size_t index, MyGUI::Widget* widget)
|
||||
{
|
||||
WidgetExtension* root = script.mElement->mRoot;
|
||||
if (!root)
|
||||
return;
|
||||
root->widget()->attachToWidget(widget);
|
||||
root->updateCoord();
|
||||
if (0 <= index && index < allSettings.size())
|
||||
allSettings[index].mElement->attachToWidget(widget);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue