gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 72034be37796c7b82ff67b9875ec673b99b5b1f3
parent 36291f73c47894e0616240414fbd693529f8b2b3
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sat, 31 Aug 2024 22:09:03 +0200

delete old user bank from disk after rename

Diffstat:
Msource/jucePluginLib/patchdb/db.cpp | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/source/jucePluginLib/patchdb/db.cpp b/source/jucePluginLib/patchdb/db.cpp @@ -216,6 +216,9 @@ namespace pluginLib::patchDB runOnLoaderThread([this, _ds, _newName] { + juce::File oldFile; + juce::File oldJsonFile; + { std::unique_lock lockDs(m_dataSourcesMutex); const auto it = m_dataSources.find(*_ds); @@ -234,6 +237,9 @@ namespace pluginLib::patchDB return; } + oldFile = getLocalStorageFile(*ds); + oldJsonFile = getJsonFile(*ds); + ds->name = _newName; m_dataSources.erase(it); @@ -244,6 +250,11 @@ namespace pluginLib::patchDB m_dirty.dataSources = true; saveJson(); + + if(oldFile.existsAsFile()) + (void)oldFile.deleteFile(); + if(oldJsonFile.existsAsFile()) + (void)oldJsonFile.deleteFile(); }); }