Fix `ObjectDisposedException` when triggering single-instance passthru

This commit is contained in:
YoshiRulz 2022-02-02 22:43:17 +10:00
parent 5d92ca3b4f
commit cff2b04dcc
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 12 additions and 3 deletions

View File

@ -291,9 +291,11 @@ namespace BizHawk.Client.EmuHawk
Func<Config> getGlobalConfig,
Action<Sound> updateGlobalSound,
string[] args,
out IMovieSession movieSession)
out IMovieSession movieSession,
out bool exitEarly)
{
movieSession = null;
exitEarly = false;
_getGlobalConfig = getGlobalConfig;
@ -301,7 +303,7 @@ namespace BizHawk.Client.EmuHawk
{
if (SingleInstanceInit(args))
{
Dispose();
exitEarly = true;
return;
}
}

View File

@ -241,7 +241,14 @@ namespace BizHawk.Client.EmuHawk
() => initialConfig,
newSound => globalSound = newSound,
args,
out var movieSession);
out var movieSession,
out var exitEarly);
if (exitEarly)
{
//TODO also use this for ArgParser failure
mf.Dispose();
return 0;
}
mf.LoadGlobalConfigFromFile = iniPath =>
{
if (!VersionInfo.DeveloperBuild && !ConfigService.IsFromSameVersion(iniPath, out var msg))