Back the VST3 plugin factory by an IPtr

This prevents REAPER from crashing when removing the last instance of a
plugin and then readding it. REAPER doesn't unload the module even after
it removes its last plugin factory instance. This means that before this
the plugin factory would be freed but we still had a seemingly valid
pointer to it that we would try to access.
This commit is contained in:
Robbert van der Helm
2021-01-21 01:51:21 +01:00
parent 4cc44c3cf7
commit 74dc8225d1
4 changed files with 22 additions and 20 deletions
@@ -18,6 +18,7 @@
#include <pluginterfaces/vst/ivstcomponent.h>
#include "../vst3.h"
#include "plugin-proxy.h"
YaPluginFactoryImpl::YaPluginFactoryImpl(Vst3PluginBridge& bridge,
@@ -16,7 +16,11 @@
#pragma once
#include "../vst3.h"
#include "../../../common/serialization/vst3/plugin-factory.h"
// We need an `IPtr<YaPluginFactoryImpl>` in `Vst3PluginBridge`, so we need to
// declare this slightly differently to avoid circular includes.
class Vst3PluginBridge;
class YaPluginFactoryImpl : public YaPluginFactory {
public: