Closed robbert-vdh closed 2 years ago
So deinit()
says that no more calls must be made into the DSO once it is called.
So you're not allowed to call it twice.
Same for init()
, the host must call it only once, because init()
may overwrite data that are in use by a previously created plugin instance.
Ah regarding deinit()
, I'm not sure if should be called if init()
returned false.
Yeah it seemed logical to me that you wouldn't be able to do it (how can you deinitialize something that hasn't been initialized?). But @tim-janik thought otherwise, hence this issue.
I'd say that if init()
failed, then the host must not call deinit()
nor any other clap related symbols from the DSO.
It would make sense to me that calling this function is only ever valid after
init()
has returned true:https://github.com/free-audio/clap/blob/55ee06f776669b94d63247a9c1dcb7dfa6056587/include/clap/entry.h#L33-L46
And as a related question, are plugins supposed to do reference counting in
init()
/deinit()
? Can I callinit()
more than once? (and then calldeinit()
the same number of times afterwards)