Fix crash when closing game, while not on the main screen, with lua components active
Also delete unnecessary RemoveComponent call
This commit is contained in:
parent
6cb54b1857
commit
1d0e039cec
@ -156,12 +156,12 @@ GameController::~GameController()
|
|||||||
{
|
{
|
||||||
delete *iter;
|
delete *iter;
|
||||||
}
|
}
|
||||||
|
delete commandInterface;
|
||||||
delete gameModel;
|
delete gameModel;
|
||||||
if (gameView->CloseActiveWindow())
|
if (gameView->CloseActiveWindow())
|
||||||
{
|
{
|
||||||
delete gameView;
|
delete gameView;
|
||||||
}
|
}
|
||||||
delete commandInterface;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameController::HistoryRestore()
|
void GameController::HistoryRestore()
|
||||||
|
@ -492,7 +492,6 @@ void LuaWindow::ClearRef(LuaComponent *luaComponent)
|
|||||||
auto it = grabbed_components.find(luaComponent);
|
auto it = grabbed_components.find(luaComponent);
|
||||||
if (it != grabbed_components.end())
|
if (it != grabbed_components.end())
|
||||||
{
|
{
|
||||||
window->RemoveComponent(luaComponent->GetComponent());
|
|
||||||
it->second.Clear();
|
it->second.Clear();
|
||||||
it->first->owner_ref = it->second;
|
it->first->owner_ref = it->second;
|
||||||
grabbed_components.erase(it);
|
grabbed_components.erase(it);
|
||||||
|
Loading…
Reference in New Issue
Block a user