Skip to content

plugin asserts when host returns a clap_host_audio_ports pointer in call to clap_host->get_extension() #5

Open
@BillyDM

Description

@BillyDM

When my host returns a pointer to a clap_host_audio_ports struct after receiving the "clap.audio-ports" extension id from the plugin in clap_host->get_extension(), then the plugin later asserts with:

/home/billydm/Dev/clap-plugins/clap-helpers/include/clap/helpers/host-proxy.hxx:38: void clap::helpers::HostProxy<h, l>::getExtension(const T*&, const char*) [with T = clap_host_audio_ports; clap::helpers::MisbehaviourHandler h = clap::helpers::MisbehaviourHandler::Terminate; clap::helpers::CheckingLevel l = clap::helpers::CheckingLevel::Maximal]: Assertion `!ptr' failed.

If my host returns a nullptr instead, then the assert does not happen.

Is the assert(!ptr) assert here at line 38 of host-proxy.hxx a bug?

   template <MisbehaviourHandler h, CheckingLevel l>
   template <typename T>
   void HostProxy<h, l>::getExtension(const T *&ptr, const char *id) noexcept {
      assert(!ptr);
      assert(id);

      if (_host->get_extension)
         ptr = static_cast<const T *>(_host->get_extension(_host, id));
   }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions