Fix possible TAStudio NRE (squashed PR #3936)

* Skip `AskSaveChanges` in disposed `TAStudio`, fix #3499

* Revert "Skip `AskSaveChanges` in disposed `TAStudio`, fix #3499"

This reverts commit eabe939547.

* Stop calling `AskSaveChanges()` on inactive tools, fix #3499
This commit is contained in:
kalimag 2024-06-05 02:00:55 +02:00 committed by GitHub
parent 5da5697f8f
commit 2c6129fb68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View File

@ -97,7 +97,7 @@ namespace BizHawk.Client.EmuHawk
public override bool AskSaveChanges()
{
if (_unsavedZones.Count == 0 || IsDisposed)
if (_unsavedZones.Count == 0)
{
return true;
}

View File

@ -616,9 +616,7 @@ namespace BizHawk.Client.EmuHawk
return true;
}
return _tools
.Select(tool => tool.AskSaveChanges())
.All(result => result);
return _tools.TrueForAll(tool => !tool.IsActive || tool.AskSaveChanges());
}
/// <summary>