Drop IPlugView pointer when host drops proxy

This commit is contained in:
Robbert van der Helm
2020-12-19 22:17:10 +01:00
parent b7047a5281
commit 7306809991
6 changed files with 40 additions and 6 deletions
+2 -1
View File
@@ -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.