Allow null pointers in IEditController::setComponentHandler

This commit is contained in:
Robbert van der Helm
2021-01-24 14:51:18 +01:00
parent 0044bc6b60
commit 77414c80d6
4 changed files with 41 additions and 16 deletions
+11 -7
View File
@@ -364,14 +364,18 @@ void Vst3Bridge::run() {
},
[&](YaEditController::SetComponentHandler& request)
-> YaEditController::SetComponentHandler::Response {
// We'll create a proxy object for the component handler and
// pass that to the initialize function. The lifetime of this
// object is tied to that of the actual plugin object we're
// proxying for.
// If the host passed a valid component handler, then we'll
// create a proxy object for the component handler and pass that
// to the initialize function. The lifetime of this object is
// tied to that of the actual plugin object we're proxying for.
// Otherwise we'll also pass a null pointer. This often happens
// just before the host terminates the plugin.
object_instances[request.instance_id].component_handler_proxy =
Steinberg::owned(new Vst3ComponentHandlerProxyImpl(
*this,
std::move(request.component_handler_proxy_args)));
request.component_handler_proxy_args
? Steinberg::owned(new Vst3ComponentHandlerProxyImpl(
*this,
std::move(*request.component_handler_proxy_args)))
: nullptr;
return object_instances[request.instance_id]
.edit_controller->setComponentHandler(