From 89d938dd3a01bf3d498d2971cd1d37434e4e9abf Mon Sep 17 00:00:00 2001 From: hogliux Date: Mon, 8 Aug 2016 18:44:01 +0100 Subject: [PATCH] Make sure to not remove a native component twice Fixes #88 --- modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm index 01ab9d31ec..e2412c9e2c 100644 --- a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm @@ -199,10 +199,12 @@ void NSViewComponent::setView (void* const view) { if (view != getView()) { - attachment = nullptr; + ReferenceCountedObject* object = nullptr; if (view != nullptr) - attachment = attachViewToComponent (*this, view); + object = attachViewToComponent (*this, view); + + attachment = object; } }