Skip to content

Commit

Permalink
gio: return NULL from spawn_blocking's underlying gtask
Browse files Browse the repository at this point in the history
This tells GIO that the task did in fact complete, and avoids a log
message when the task is finalised
  • Loading branch information
ZanderBrown authored and sdroege committed Dec 9, 2023
1 parent 5e14a8d commit eba8f9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gio/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,10 @@ where
// use Cancellable::NONE as source obj to fulfill `Send` requirement
let task = unsafe { Task::<bool>::new(Cancellable::NONE, Cancellable::NONE, |_, _| {}) };
let (join, tx) = JoinHandle::new();
task.run_in_thread(move |_, _: Option<&Cancellable>, _| {
task.run_in_thread(move |task, _: Option<&Cancellable>, _| {
let res = panic::catch_unwind(panic::AssertUnwindSafe(func));
let _ = tx.send(res);
unsafe { ffi::g_task_return_pointer(task.to_glib_none().0, ptr::null_mut(), None) }
});

join
Expand Down

0 comments on commit eba8f9d

Please sign in to comment.