Fix `ObjectDisposedException` when triggering single-instance passthru
This commit is contained in:
parent
5d92ca3b4f
commit
cff2b04dcc
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue