mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-17 14:10:02 +02:00
Drop IPlugView pointer when host drops proxy
This commit is contained in:
@@ -35,6 +35,15 @@ void Vst3Logger::log_unknown_interface(
|
||||
}
|
||||
}
|
||||
|
||||
bool Vst3Logger::log_request(bool is_host_vst,
|
||||
const Vst3PlugViewProxy::Destruct& request) {
|
||||
return log_request_base(is_host_vst, [&](auto& message) {
|
||||
// We don't know what class this instance was originally instantiated
|
||||
// as, but it also doesn't really matter
|
||||
message << request.owner_instance_id << ": IPlugView::~IPlugView()";
|
||||
});
|
||||
}
|
||||
|
||||
bool Vst3Logger::log_request(bool is_host_vst,
|
||||
const Vst3PluginProxy::Construct& request) {
|
||||
return log_request_base(is_host_vst, [&](auto& message) {
|
||||
|
||||
@@ -59,6 +59,7 @@ class Vst3Logger {
|
||||
// `log_request()` call returned `true`. This way we can filter out the
|
||||
// log message for the response together with the request.
|
||||
|
||||
bool log_request(bool is_host_vst, const Vst3PlugViewProxy::Destruct&);
|
||||
bool log_request(bool is_host_vst, const Vst3PluginProxy::Construct&);
|
||||
bool log_request(bool is_host_vst, const Vst3PluginProxy::Destruct&);
|
||||
bool log_request(bool is_host_vst, const Vst3PluginProxy::SetState&);
|
||||
|
||||
@@ -59,7 +59,8 @@ struct WantsConfiguration {
|
||||
* encodes the information we request or the operation we want to perform. A
|
||||
* request of type `ControlRequest(T)` should send back a `T::Response`.
|
||||
*/
|
||||
using ControlRequest = std::variant<Vst3PluginProxy::Construct,
|
||||
using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
||||
Vst3PluginProxy::Construct,
|
||||
Vst3PluginProxy::Destruct,
|
||||
Vst3PluginProxy::SetState,
|
||||
Vst3PluginProxy::GetState,
|
||||
|
||||
@@ -72,6 +72,22 @@ class Vst3PlugViewProxy : public YaPlugView {
|
||||
*/
|
||||
Vst3PlugViewProxy(const ConstructArgs&& args);
|
||||
|
||||
/**
|
||||
* Message to request the Wine plugin host to destroy the `IPlugView*`
|
||||
* returned by the object with the given instance ID. Sent from the
|
||||
* destructor of `Vst3PlugViewProxyImpl`.
|
||||
*/
|
||||
struct Destruct {
|
||||
using Response = Ack;
|
||||
|
||||
native_size_t owner_instance_id;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(owner_instance_id);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @remark The plugin side implementation should send a control message to
|
||||
* clean up the instance on the Wine side in its destructor.
|
||||
|
||||
Reference in New Issue
Block a user