Closed czipperz closed 8 years ago
The Drop trait implemented for taglib::File will destruct the Tag even though Rust thinks their lifetimes are independent (https://github.com/ebassi/taglib-rust/blob/master/src/lib.rs#L213).
Drop
taglib::File
Tag
Rust
Here is some example code of the problem (where "song.mp3" is a real, valid mp3 file):
extern crate taglib; fn main() { let tags = get_tags(&"song.mp3".to_string()); tags.artist(); } fn get_tags(fname: &String) -> taglib::Tag { let file = taglib::File::new(&fname).unwrap(); file.tag().unwrap() }
Running this will result in a signal 11 on my machine:
$ cargo run --verbose Fresh libc v0.1.12 Fresh taglib v0.1.0 Fresh test v0.1.0 (file:///home/czipperz/test) Running `target/debug/test` Process didn't exit successfully: `target/debug/test` (signal: 11)
You'll need to push this to http://crates.io
Thanks for the commit!
The
Drop
trait implemented fortaglib::File
will destruct theTag
even thoughRust
thinks their lifetimes are independent (https://github.com/ebassi/taglib-rust/blob/master/src/lib.rs#L213).Here is some example code of the problem (where "song.mp3" is a real, valid mp3 file):
Running this will result in a signal 11 on my machine: