From c52da3639a3cfe229e1e890712e85c5b52eff0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 30 Dec 2017 12:08:26 +0200 Subject: [PATCH] Fix memory leak for gst_video::convert_sample_async() Values are passed owned to the callback --- gstreamer-video/src/functions.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gstreamer-video/src/functions.rs b/gstreamer-video/src/functions.rs index 7bff9d539..13bf41411 100644 --- a/gstreamer-video/src/functions.rs +++ b/gstreamer-video/src/functions.rs @@ -12,7 +12,7 @@ use glib_ffi; use gst; use glib; -use glib::translate::{from_glib_full, from_glib_none, ToGlib, ToGlibPtr}; +use glib::translate::{from_glib_full, ToGlib, ToGlibPtr}; use std::ptr; use std::mem; @@ -59,9 +59,9 @@ pub fn convert_sample_async( let callback = callback.take().unwrap(); if error.is_null() { - callback(Ok(from_glib_none(sample))) + callback(Ok(from_glib_full(sample))) } else { - callback(Err(from_glib_none(error))) + callback(Err(from_glib_full(error))) } } unsafe extern "C" fn convert_sample_async_free(user_data: glib_ffi::gpointer)