From: <sv...@op...> - 2024-09-17 21:58:35
|
Author: sagamusix Date: Tue Sep 17 23:58:22 2024 New Revision: 21596 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21596 Log: [Fix] Song Cleanup: Allow plugins only referenced by to-be-removed channels to be removed as well. Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp ============================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp Sun Sep 15 09:32:14 2024 (r21595) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp Tue Sep 17 23:58:22 2024 (r21596) @@ -168,16 +168,16 @@ if(m_CheckBoxes[kRearrangeSamples]) modified |= RearrangeSamples(); } - // Plugins - if(m_CheckBoxes[kRemoveAllPlugins]) modified |= RemoveAllPlugins(); - if(m_CheckBoxes[kCleanupPlugins]) modified |= RemoveUnusedPlugins(); - // Create samplepack if(m_CheckBoxes[kResetVariables]) modified |= ResetVariables(); // Remove unused channels if(m_CheckBoxes[kCleanupChannels]) modified |= RemoveUnusedChannels(); + // Plugins (done last because they can be referenced by both instruments and channels) + if(m_CheckBoxes[kRemoveAllPlugins]) modified |= RemoveAllPlugins(); + if(m_CheckBoxes[kCleanupPlugins]) modified |= RemoveUnusedPlugins(); + if(modified) modDoc.SetModified(); modDoc.UpdateAllViews(nullptr, UpdateHint().ModType()); logcapturer.ShowLog(true); |