Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels