mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-16 21:50:11 +02:00
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:
@@ -22,10 +22,8 @@
|
||||
#include "../../common/communication/vst3.h"
|
||||
#include "../../common/logging/vst3.h"
|
||||
#include "common.h"
|
||||
|
||||
// Forward declarations
|
||||
class Vst3PluginProxyImpl;
|
||||
class YaPluginFactoryImpl;
|
||||
#include "vst3-impls/plugin-factory.h"
|
||||
#include "vst3-impls/plugin-proxy.h"
|
||||
|
||||
/**
|
||||
* This handles the communication between the native host and a VST3 plugin
|
||||
@@ -139,13 +137,11 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
|
||||
* Our plugin factory. All information about the plugin and its supported
|
||||
* classes are copied directly from the Windows VST3 plugin's factory on the
|
||||
* Wine side, and we'll provide an implementation that can send control
|
||||
* messages to the Wine plugin host. As explained in `get_plugin_factory()`,
|
||||
* this cannot be a smart pointer because the factory is supposed to free
|
||||
* itself when the host removes its last adopted `IPtr<IpluginFactory>`.
|
||||
* messages to the Wine plugin host.
|
||||
*
|
||||
* @related get_plugin_factory
|
||||
*/
|
||||
YaPluginFactoryImpl* plugin_factory = nullptr;
|
||||
Steinberg::IPtr<YaPluginFactoryImpl> plugin_factory = nullptr;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user