Browse Source

Fix for VST3 host view ref-counting.

tags/2021-05-28
jules 11 years ago
parent
commit
c84f7085ca
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp

+ 8
- 5
modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -998,7 +998,8 @@ private:
void releaseFactory() void releaseFactory()
{ {
const Steinberg::FReleaser releaser (factory);
if (factory != nullptr)
factory->release();
} }
#if JUCE_WINDOWS #if JUCE_WINDOWS
@@ -1222,7 +1223,7 @@ public:
[pluginHandle release]; [pluginHandle release];
#endif #endif
const Steinberg::FReleaser releaser (view);
view = nullptr;
} }
JUCE_DECLARE_VST3_COM_REF_METHODS JUCE_DECLARE_VST3_COM_REF_METHODS
@@ -1284,7 +1285,8 @@ public:
dummyComponent.setBounds (0, 0, (int) rect.getWidth(), (int) rect.getHeight()); dummyComponent.setBounds (0, 0, (int) rect.getWidth(), (int) rect.getHeight());
#endif #endif
Desktop::getInstance().getMainMouseSource().forceMouseCursorUpdate(); // Some plugins don't update their cursor correctly when mousing out the window
// Some plugins don't update their cursor correctly when mousing out the window
Desktop::getInstance().getMainMouseSource().forceMouseCursorUpdate();
recursiveResize = false; recursiveResize = false;
} }
@@ -1316,7 +1318,7 @@ public:
private: private:
//============================================================================== //==============================================================================
Atomic<int> refCount; Atomic<int> refCount;
IPlugView* view; // N.B.: Don't use a ComSmartPtr here! The view should start with a refCount of 1, and does NOT need to be incremented!
ComSmartPtr<IPlugView> view;
#if JUCE_WINDOWS #if JUCE_WINDOWS
class ChildComponent : public Component class ChildComponent : public Component
@@ -1452,7 +1454,8 @@ public:
if (! fetchComponentAndController (factory, factory->countClasses())) if (! fetchComponentAndController (factory, factory->countClasses()))
return false; return false;
editController->initialize (host->getFUnknown()); // (May return an error if the plugin combines the IComponent and IEditController implementations)
// (May return an error if the plugin combines the IComponent and IEditController implementations)
editController->initialize (host->getFUnknown());
isControllerInitialised = true; isControllerInitialised = true;
editController->setComponentHandler (host); editController->setComponentHandler (host);


Loading…
Cancel
Save