From edd828a554b2f877e9dc6c049e675443d658df66 Mon Sep 17 00:00:00 2001 From: Agnieszka Janowicz Date: Thu, 6 Oct 2016 15:40:34 +0100 Subject: [PATCH] Fix memory leak in BluetoothMidiSelectorOverlay --- .../juce_ios_BluetoothMidiDevicePairingDialogue.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm b/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm index 8e1288e329..c5bd03eafe 100644 --- a/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm +++ b/modules/juce_audio_utils/native/juce_ios_BluetoothMidiDevicePairingDialogue.mm @@ -73,12 +73,19 @@ public: setBounds (0, 0, getParentWidth(), getParentHeight()); toFront (true); - nativeSelectorComponent.setView ([[[BluetoothSelectorView alloc] init] getView]); + selectorView = [[BluetoothSelectorView alloc] init]; + nativeSelectorComponent.setView ([selectorView getView]); addAndMakeVisible (nativeSelectorComponent); enterModalState (true, nullptr, true); } + ~BluetoothMidiSelectorOverlay() + { + [selectorView release]; + } + + void paint (Graphics& g) override { g.fillAll (Colours::black.withAlpha (0.5f)); @@ -108,6 +115,7 @@ private: } UIViewComponent nativeSelectorComponent; + BluetoothSelectorView* selectorView; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BluetoothMidiSelectorOverlay) };