Skip to content

Min API externals receive zero length args from certain sources if not declared threadsafe #185

@rtu-ableton

Description

@rtu-ableton

If an external is created with the Min API, some sources connected to the inlet work (e.g. a message box, UI element) and others don't (e.g. midi messages coming from midiin).

In this example code, a list of length 2 from midiin will trigger the error:

message<> test{
    this, "test", "test input", [this](const atoms& args, int inlet) -> atoms {
      (void)inlet;
     
      if (args.size() < 1)
      {
        cerr << "bad list length, size = " << args.size() << endl;
        return {};
      }

The problem goes away if the message is declared threadsafe via message<threadsafe::yes> but either this should not be necessary, or a meaningful error should be displayed somehow to help the dev.

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