From 1a7253929ac26ec0fdbe21b8b8816672cedc3390 Mon Sep 17 00:00:00 2001 From: Michal Odnous Date: Tue, 9 Jan 2024 19:48:44 +0000 Subject: [PATCH] Make plug initialisation step compliant with the spec According to the official header [plugin.h](https://github.com/free-audio/clap/blob/main/include/clap/plugin.h) ``` // If init returns false, the host must destroy the plugin instance. // If init returns true, then the plugin is initialized and in the deactivated state. ``` --- src/clap-info/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/clap-info/main.cpp b/src/clap-info/main.cpp index 212eec2..91899aa 100644 --- a/src/clap-info/main.cpp +++ b/src/clap-info/main.cpp @@ -358,7 +358,12 @@ int main(int argc, char **argv) return 5; } - inst->init(inst); + bool result = inst->init(inst); + if (!result) { + std::cerr << "Unable to init plugin" << std::endl; + doc.active = false; + return 6; + } inst->activate(inst, 48000, 32, 4096); Json::Value extensions;