From 679ef3f1dc3ab71ed0c8729ee31cf5e48a009221 Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 20 Sep 2016 18:05:36 +0100 Subject: [PATCH] Fixed a bug where VST plug-in editors using OpenGL would not work correctly in the JUCE plug-in host --- modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm index 01ab9d31ec..2fcf0e047d 100644 --- a/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm +++ b/modules/juce_gui_extra/native/juce_mac_NSViewComponent.mm @@ -177,6 +177,7 @@ public: NSView* const view; + typedef ReferenceCountedObjectPtr Ptr; private: Component& owner; ComponentPeer* currentPeer; @@ -199,10 +200,14 @@ void NSViewComponent::setView (void* const view) { if (view != getView()) { + NSViewAttachment::Ptr old = attachment; + attachment = nullptr; if (view != nullptr) attachment = attachViewToComponent (*this, view); + + old = nullptr; } }