Lifetime of libvlc_new args
Posted: 23 Oct 2018 16:07
Hello,
I'm currently implementing the argument option for libvlc_new in rust.
Because of rust internal Strings to c_string conversion I have to ask: does the argument have to be alive longer than the call of libvlc_new ?
Example in pseudo code
I've tried digging through the source but the amount of places where arg is used and the missing doc about the lifetime of the argument makes it pretty hard to understand whether or not I need to keep this variable allocated.
I'm currently implementing the argument option for libvlc_new in rust.
Because of rust internal Strings to c_string conversion I have to ask: does the argument have to be alive longer than the call of libvlc_new ?
Example in pseudo code
Code: Select all
var a = ["--no-video"];
var instance = libvlc_new(1,a);
free(a);
.. use instance