Fix crash on exit if a Lua component is added to a Lua window
Very similar in nature to the problem fixed by 0fcad65d
. Again, it'd be massive help if we didn't destroy the Lua state explicitly in LSI's dtor. But this is not worth refactoring LSI for.
This commit is contained in:
parent
7ab720d847
commit
6ef505ccca
@ -4381,6 +4381,7 @@ LuaScriptInterface::~LuaScriptInterface() {
|
|||||||
luacon_ci->Window->RemoveComponent(component_and_ref.first->GetComponent());
|
luacon_ci->Window->RemoveComponent(component_and_ref.first->GetComponent());
|
||||||
component_and_ref.second.Clear();
|
component_and_ref.second.Clear();
|
||||||
component_and_ref.first->owner_ref = component_and_ref.second;
|
component_and_ref.first->owner_ref = component_and_ref.second;
|
||||||
|
component_and_ref.first->SetParentWindow(nullptr);
|
||||||
}
|
}
|
||||||
luaChangeTypeHandlers.clear();
|
luaChangeTypeHandlers.clear();
|
||||||
luaCreateAllowedHandlers.clear();
|
luaCreateAllowedHandlers.clear();
|
||||||
|
@ -494,6 +494,7 @@ void LuaWindow::ClearRef(LuaComponent *luaComponent)
|
|||||||
{
|
{
|
||||||
it->second.Clear();
|
it->second.Clear();
|
||||||
it->first->owner_ref = it->second;
|
it->first->owner_ref = it->second;
|
||||||
|
it->first->SetParentWindow(nullptr);
|
||||||
grabbed_components.erase(it);
|
grabbed_components.erase(it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -505,6 +506,7 @@ LuaWindow::~LuaWindow()
|
|||||||
window->RemoveComponent(component_and_ref.first->GetComponent());
|
window->RemoveComponent(component_and_ref.first->GetComponent());
|
||||||
component_and_ref.second.Clear();
|
component_and_ref.second.Clear();
|
||||||
component_and_ref.first->owner_ref = component_and_ref.second;
|
component_and_ref.first->owner_ref = component_and_ref.second;
|
||||||
|
component_and_ref.first->SetParentWindow(nullptr);
|
||||||
}
|
}
|
||||||
window->CloseActiveWindow();
|
window->CloseActiveWindow();
|
||||||
delete window;
|
delete window;
|
||||||
|
Reference in New Issue
Block a user