mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-23 08:22:55 +02:00
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:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user