diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 418c61657..8bafa099d 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -704,7 +704,7 @@ impl> PadExtManual for O { self.as_ref().to_glib_none().0, Some(trampoline_pad_task::), into_raw_pad_task(func), - Some(destroy_closure::), + Some(destroy_closure_pad_task::), ), "Failed to start pad task", ) @@ -1351,6 +1351,10 @@ fn into_raw_pad_task(func: F) -> gpointer { Box::into_raw(func) as gpointer } +unsafe extern "C" fn destroy_closure_pad_task(ptr: gpointer) { + Box::>::from_raw(ptr as *mut _); +} + #[cfg(test)] mod tests { use super::*;