IPluginBase usage

In a host program I maintain, initialize is called directly on the IComponent after loading it. Later, the corresponding IEditController is located, and then initialize is called on that object too.

The problem is that one plugin I’ve tested crashes during the call to IEditController::initialize. It looks like this plugin is implemented using a combined IComponent and IEditController, so the initialize function is the “same” in both calls, and the plugin can’t handle the same initialize function being called twice in a row.

The documentation does not make it clear whether initialize may be called on the IEditController if it was already called on the IComponent, so I’m not sure if the bug is in the plugin or in the host. Is this allowed, or should the host always check for this case and avoid calling initialize multiple times on combined components?

I note that the creation example on this page avoids calling initialize twice, but does not make it clear whether or not this is a requirement. It might be beneficial to other developers to make the documentation here (and also the class documentation for IPluginBase) a bit more explicit about allowed call sequences.

It would also be useful to know whether IPluginBase::terminate has any special requirements regarding the number of times it may be called.

Hi,
initialize and terminate must only be called once per object instance. Thus if IEditController and IAudioProcessor is implemented in one object you are only allowed to call once the initialize method of such objects.
We will make this more explicit in the documentation. Thanks for asking.

1 Like