diff --git a/NotEnoughAV1Encodes/Controls/MainWindowTopButtons.xaml.cs b/NotEnoughAV1Encodes/Controls/MainWindowTopButtons.xaml.cs index 0c878c1..2d3dc97 100644 --- a/NotEnoughAV1Encodes/Controls/MainWindowTopButtons.xaml.cs +++ b/NotEnoughAV1Encodes/Controls/MainWindowTopButtons.xaml.cs @@ -371,8 +371,11 @@ private void AddToQueue(string identifier, bool skipSubs) queueElement.FrameCount += queueElement.FrameCount; } + // We want to loose all object references, only took 3 hours to figure this out + var queueClone = Queue.QueueElement.DeepCopy(queueElement); + // Add to Queue - mainWindow.QueueTabControl.ListBoxQueue.Items.Add(queueElement); + mainWindow.QueueTabControl.ListBoxQueue.Items.Add(queueClone); Directory.CreateDirectory(Path.Combine(Global.AppData, "NEAV1E", "Queue")); diff --git a/NotEnoughAV1Encodes/Queue/QueueElement.cs b/NotEnoughAV1Encodes/Queue/QueueElement.cs index ddf968f..7166ff7 100644 --- a/NotEnoughAV1Encodes/Queue/QueueElement.cs +++ b/NotEnoughAV1Encodes/Queue/QueueElement.cs @@ -190,5 +190,12 @@ private static string GetBetween(string strSource, string strStart, string strEn } return "0"; } + + public static QueueElement DeepCopy(QueueElement queueElement) + { + // Cursed + var serialized = JsonConvert.SerializeObject(queueElement); + return JsonConvert.DeserializeObject(serialized); + } } }