From 1c8d0dc245a5dfac8a1557698173529aa172f8eb Mon Sep 17 00:00:00 2001 From: Maiko Date: Sun, 28 Jan 2024 20:43:48 +0900 Subject: [PATCH] Fix ReleaseSingersNotInUse bug --- OpenUtau.Core/SingerManager.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OpenUtau.Core/SingerManager.cs b/OpenUtau.Core/SingerManager.cs index 382b08a61..708161375 100644 --- a/OpenUtau.Core/SingerManager.cs +++ b/OpenUtau.Core/SingerManager.cs @@ -119,7 +119,7 @@ public void ReleaseSingersNotInUse(UProject project) { var singersInUse = new HashSet(); foreach(var track in project.tracks){ var singer = track.Singer; - if(singer != null){ + if(singer != null && singer.Found && !singersInUse.Contains(singer)) { singersInUse.Add(singer); } } @@ -127,11 +127,10 @@ public void ReleaseSingersNotInUse(UProject project) { foreach(var singer in singersUsed){ if(!singersInUse.Contains(singer)){ singer.FreeMemory(); - singersUsed.Remove(singer); } } //Update singers used - singersUsed.UnionWith(singersInUse); + singersUsed = singersInUse; } } }