From 6c8d4c536a31038cd711fade1427497675a931f6 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Fri, 17 Mar 2023 11:50:30 +1000 Subject: [PATCH] Clear `MovieSession._queuedMovie` if rom load fails (resolves #3582) for #3582, `MovieSession.QueuedCoreName`, which gets passed to `RomLoader`, evaluated to a nonexistent core name and couldn't be cleared --- src/BizHawk.Client.Common/movie/MovieSession.cs | 3 +++ src/BizHawk.Client.Common/movie/interfaces/IMovieSession.cs | 3 +++ src/BizHawk.Client.EmuHawk/MainForm.Movie.cs | 1 + 3 files changed, 7 insertions(+) diff --git a/src/BizHawk.Client.Common/movie/MovieSession.cs b/src/BizHawk.Client.Common/movie/MovieSession.cs index bab78f4e84..71335f79fc 100644 --- a/src/BizHawk.Client.Common/movie/MovieSession.cs +++ b/src/BizHawk.Client.Common/movie/MovieSession.cs @@ -261,6 +261,9 @@ namespace BizHawk.Client.Common } } + public void AbortQueuedMovie() + => _queuedMovie = null; + public void StopMovie(bool saveChanges = true) { if (Movie.IsActive()) diff --git a/src/BizHawk.Client.Common/movie/interfaces/IMovieSession.cs b/src/BizHawk.Client.Common/movie/interfaces/IMovieSession.cs index 1d8fc1f174..e245c12a61 100644 --- a/src/BizHawk.Client.Common/movie/interfaces/IMovieSession.cs +++ b/src/BizHawk.Client.Common/movie/interfaces/IMovieSession.cs @@ -84,6 +84,9 @@ namespace BizHawk.Client.Common /// void RunQueuedMovie(bool recordMode, IEmulator emulator); + /// clears the queued movie + void AbortQueuedMovie(); + void StopMovie(bool saveChanges = true); /// diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs b/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs index 554c5c4c5a..fa08f5bbe9 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Movie.cs @@ -48,6 +48,7 @@ namespace BizHawk.Client.EmuHawk } finally { + MovieSession.AbortQueuedMovie(); Config.PreferredCores = oldPreferredCores; }