hey, quick question.
i’ve moved away from ScopedPointer and started using unique_ptr, however, I’m doing something wrong because my compiler (when plugin is closed) gives message
‘GummiClipDistortionV0.exe’ (Win32): Unloaded ‘C:\Windows\System32\Windows.UI.dll’
The thread 0x3004 has exited with code 0 (0x0).
The thread 0x15a4 has exited with code 0 (0x0).
The thread 0x1578 has exited with code 0 (0x0).
The thread 0x7ac has exited with code 0 (0x0).
The thread 0x1870 has exited with code 0 (0x0).
The thread 0x17f8 has exited with code 0 (0x0).
The thread 0x3180 has exited with code 0 (0x0).
The thread 0x1344 has exited with code 0 (0x0).
Detected memory leaks!
Dumping objects →
{4967} normal block at 0x000001A5CA3B9100, 16 bytes long.
Data: < P P > 00 00 00 00 00 00 00 00 50 00 00 00 50 00 00 00
{4484} normal block at 0x000001A5CA3B9240, 16 bytes long.
Data: < P P > 00 00 00 00 00 00 00 00 50 00 00 00 50 00 00 00
Object dump complete.
The program ‘[12476] GummiClipDistortionV0.exe’ has exited with code 0 (0x0).
i have tested and retested and i know it’s definitely the attachment leaking. i solved the issue with slider leaking by overriding the destructor in my custom slider class.
creating
std::unique_ptr<juce::AudioProcessorValueTreeState::SliderAttachment> attachmentInputGain;
std::unique_ptr<GCD_RotarySlider> sliderInputGain;
constructor
sliderInputGain.reset(new GCD_RotarySlider);
addAndMakeVisible(sliderInputGain.get());
attachmentInputGain.reset(new juce::AudioProcessorValueTreeState::SliderAttachment(audioProcessor.apvts, "id_v0_input_gain", *sliderInputGain));
destructor
attachmentInputGain.reset(nullptr);
sliderInputGain.reset(nullptr);
any advice?