mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 20:40:11 +02:00
Allow passing null pointers to IPlugView::setFrame
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <pluginterfaces/gui/iplugview.h>
|
||||
#include "bitsery/ext/std_optional.h"
|
||||
|
||||
#include "../../common.h"
|
||||
#include "../base.h"
|
||||
@@ -291,12 +292,18 @@ class YaPlugView : public Steinberg::IPlugView {
|
||||
|
||||
native_size_t owner_instance_id;
|
||||
|
||||
Vst3PlugFrameProxy::ConstructArgs plug_frame_args;
|
||||
/**
|
||||
* Some hosts will pass a null pointer to explicitly destroy the
|
||||
* `IPlugFrame` instance before freeing the plugin's `IPlugView`
|
||||
* instance. This also happens in the SDK, so this seems like valid
|
||||
* behaviour we should support.
|
||||
*/
|
||||
std::optional<Vst3PlugFrameProxy::ConstructArgs> plug_frame_args;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(owner_instance_id);
|
||||
s.object(plug_frame_args);
|
||||
s.ext(plug_frame_args, bitsery::ext::StdOptional{});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user