From 95b1525c3fe79fed25141b5157f96166b477d107 Mon Sep 17 00:00:00 2001 From: George Reales Date: Thu, 10 Mar 2022 18:55:58 +0100 Subject: [PATCH] Fixed leaking components --- Source/PluginEditor.cpp | 8 ++++---- Source/PluginEditor.h | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 176890b..0f92e97 100755 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -521,17 +521,17 @@ void ObxdAudioProcessorEditor::loadSkin (ObxdAudioProcessor& ownerFilter) } if (name == "voiceSwitch"){ - voiceSwitch = addList (x, y, w, h, ownerFilter, VOICE_COUNT, "VoiceCount", "voices"); + voiceSwitch.reset(addList (x, y, w, h, ownerFilter, VOICE_COUNT, "VoiceCount", "voices")); voiceSwitch->setLookAndFeel(&this->getLookAndFeel()); - mappingComps["voiceSwitch"] = voiceSwitch; + mappingComps["voiceSwitch"] = voiceSwitch.get(); } if (name == "legatoSwitch"){ - legatoSwitch = addList (x, y, w, h, ownerFilter, LEGATOMODE, "Legato", "legato"); + legatoSwitch.reset(addList (x, y, w, h, ownerFilter, LEGATOMODE, "Legato", "legato")); legatoSwitch->setLookAndFeel(&this->getLookAndFeel()); - mappingComps["legatoSwitch"] = legatoSwitch; + mappingComps["legatoSwitch"] = legatoSwitch.get(); } diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 5efb1dd..2ea0fc9 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -272,8 +272,7 @@ private: *midiLearnButton=nullptr, *midiUnlearnButton=nullptr; - ButtonList *voiceSwitch = nullptr, - *legatoSwitch = nullptr; + std::unique_ptr voiceSwitch, legatoSwitch; File skinFolder;