Skip to content

Client::new() returns error -50 after 6 calls #32

@sourcebox

Description

@sourcebox

My application uses the midir crate that uses coremidi as a dependency. The original issue is tracked here Boddlnagg/midir#86

The reason for continously creating a client for scanning the ports because the cross-platform midir crate does not support change notifications yet.

While there is a workaround for the problem, it still would be nice to address the issue if possible. I would expect that the acquired client resource is closed at the end of each loop iteration as the variable goes out of scope.

Demo code:

use coremidi::Client;

fn main() {
    loop {
        let client = Client::new("test midi client");

        match client {
            Ok(client) => {
                println!("{:?}", &client);
            }
            Err(error) => {
                println!("{:?}", error);
            }
        }

        std::thread::sleep(std::time::Duration::from_millis(1000));
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions