arturoc / gstreamer1.0-rs

Idiomatic bindings for Gstreamer on Rust.
MIT License
36 stars 14 forks source link

Implement Drop for various types #12

Closed Blei closed 8 years ago

Blei commented 8 years ago

It looks like various wrapped C types are never cleaned up.

arturoc commented 8 years ago

can you show any specific example?

Blei commented 8 years ago

E.g. everything returned by gst_element_factory_make() is a GstObject which should be unref'd using gst_object_unref() when no longer needed.

arturoc commented 8 years ago

i'm checking this and everything allocated with gst_element_factory_make (which is only used in Element::new) is being correctly unref'd by Element's Drop implementation in https://github.com/arturoc/gstreamer1.0-rs/blob/master/src/element.rs#L17-L23, no?

arturoc commented 8 years ago

Every object now uses Object or MiniObject now which have their own destructors so everything should be properly freed now

Blei commented 8 years ago

You're right, I completely missed that. Thank you!