Skip to content

Commit 8458076

Browse files
author
Matteo Biggio
committed
gtask: fix memory leak in when calling g_task_return_value
The g_task_return_value function does not take ownership of the input GValue pointer, but just borrows it to make a copy: https://developer-old.gnome.org/gio/unstable/GTask.html#g-task-return-value The Rust caller should take care of the deallocation.
1 parent 79e7a30 commit 8458076

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gio/src/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ macro_rules! task_impl {
255255
Ok(v) => unsafe {
256256
ffi::g_task_return_value(
257257
self.to_glib_none().0,
258-
v.to_value().to_glib_full() as *mut _,
258+
v.to_value().to_glib_none().0 as *mut _,
259259
)
260260
},
261261
#[cfg(not(feature = "v2_64"))]

0 commit comments

Comments
 (0)