Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

'Illegal call' after alDeleteSources #3

Open
lynks-- opened this issue Aug 24, 2016 · 0 comments
Open

'Illegal call' after alDeleteSources #3

lynks-- opened this issue Aug 24, 2016 · 0 comments

Comments

@lynks--
Copy link

lynks-- commented Aug 24, 2016

The following example panics during dropping the al resources;

extern crate openal;

struct ALContainer<'a, 'b> {
    pub listener: openal::Listener<'a>,
    pub streams: Vec<openal::source::Stream<'b>>,
}
fn main() {
    let listener = openal::listener::default(
        &openal::listener::Attributes::default()
    ).unwrap();

    let mut streams = Vec::new();
    for _ in 0..4 {
        streams.push(listener.source().unwrap().stream());
    }

    let container = ALContainer {
        listener: listener,
        streams: streams,
    };
}

Specifically;
thread '<main>' panicked at 'Illegal call.', src/source/source.rs:373

Which is the call to alDeleteSources(1, &self.id);

If we do not add the listener and streams to the ALContainer struct, the panic is avoided, so I guess it's something to do with the order in which things are being dropped as they go out of scope.

@lynks-- lynks-- changed the title 'Illecal call' after alDeleteSources 'Illegal call' after alDeleteSource Aug 24, 2016
@lynks-- lynks-- changed the title 'Illegal call' after alDeleteSource 'Illegal call' after alDeleteSources Aug 24, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant