From 8b7f7fe79b6b9bb797155765a1a6d28b173ffaf9 Mon Sep 17 00:00:00 2001
From: zeromus <zeromus@users.noreply.github.com>
Date: Thu, 23 Apr 2020 21:20:20 -0400
Subject: [PATCH] clone melonds settings so they dont persist when canceling

---
 .../Consoles/Nintendo/NDS/MelonDS_Settable.cs                 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS_Settable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS_Settable.cs
index a246c48917..4cdf72a58b 100644
--- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS_Settable.cs
+++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS_Settable.cs
@@ -12,7 +12,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
 	{
 		private MelonSettings _settings = new MelonSettings();
 
-		public MelonSettings GetSettings() => _settings;
+		public MelonSettings GetSettings() => _settings.Clone();
 
 		public MelonSyncSettings GetSyncSettings()
 		{
@@ -97,6 +97,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
 
 		public class MelonSettings
 		{
+			public MelonSettings Clone() => (MelonSettings)MemberwiseClone();
+
 			[DisplayName("Screen Layout")]
 			[Description("Adjusts the layout of the screens")]
 			public ScreenLayoutKind ScreenLayout { get; set; } = ScreenLayoutKind.Vertical;