/// <summary> /// Constructs a new instance of the host class based on the <paramref name="hostCmdStub"/> /// (from Interop) and a reference to the current <paramref name="plugin"/>. /// </summary> /// <param name="hostCmdStub">Must not be null.</param> /// <param name="plugin">Must not be null.</param> /// <exception cref="ArgumentNullException">Thrown when <paramref name="hostCmdStub"/> or /// <paramref name="plugin"/> is not set to an instance of an object.</exception> public VstHost(IVstHostCommandStub hostCmdStub, IVstPlugin plugin) { Throw.IfArgumentIsNull(hostCmdStub, "hostCmdStub"); Throw.IfArgumentIsNull(plugin, "plugin"); HostCommandStub = hostCmdStub; Plugin = plugin; _intfMgr = new VstHostInterfaceManager(this); }
/// <summary> /// Called to dispose of this host instance. /// </summary> public void Dispose() { if (_intfMgr != null) { _intfMgr.Dispose(); _intfMgr = null; } if (HostCommandStub != null) { HostCommandStub.Dispose(); HostCommandStub = null; } Plugin = null; }