Skip to content

Commit

Permalink
Make plug initialisation step compliant with the spec
Browse files Browse the repository at this point in the history
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.
```
  • Loading branch information
odiroot authored Jan 9, 2024
1 parent 271a6f3 commit 1a72539
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/clap-info/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1a72539

Please sign in to comment.