From 02a34ad98f6272496496d94121780a68bfab75d5 Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Tue, 14 May 2024 08:18:44 -0400 Subject: [PATCH] Stop an at-exit jassert from not releasing LnF ref --- src-juce/AWConsolidatedEditor.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src-juce/AWConsolidatedEditor.cpp b/src-juce/AWConsolidatedEditor.cpp index e08f82c..f0f9e18 100644 --- a/src-juce/AWConsolidatedEditor.cpp +++ b/src-juce/AWConsolidatedEditor.cpp @@ -363,7 +363,8 @@ struct Picker : public juce::Component, public juce::TextEditor::Listener void parentHierarchyChanged() override { // We will ahve our LnF changed - resetColors(); + if (getParentComponent()) + resetColors(); } void resetColors() { @@ -832,8 +833,9 @@ struct ParamDisp : juce::Component, juce::TextEditor::Listener void parentHierarchyChanged() override { // We will ahve our LnF changed - resetColors(); - } + if (getParentComponent()) + resetColors(); + }; void resetColors() { @@ -1394,7 +1396,13 @@ AWConsolidatedAudioProcessorEditor::AWConsolidatedAudioProcessorEditor( AWConsolidatedAudioProcessorEditor::~AWConsolidatedAudioProcessorEditor() { + // release any references to the look and feel + setLookAndFeel(&juce::LookAndFeel::getDefaultLookAndFeel()); + + // detatch from processor prop file lnf->propFileWeak = nullptr; + + // stop lsitenres and timers juce::Desktop::getInstance().removeDarkModeSettingListener(this); idleTimer->stopTimer(); }