Skip to content

Commit 0409821

Browse files
ZanderBrownbilelmoussaoui
authored andcommitted
gio: return NULL from spawn_blocking's underlying gtask
This tells GIO that the task did in fact complete, and avoids a log message when the task is finalised
1 parent 6b1bdba commit 0409821

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gio/src/task.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,10 @@ where
433433
// use Cancellable::NONE as source obj to fulfill `Send` requirement
434434
let task = unsafe { Task::<bool>::new(Cancellable::NONE, Cancellable::NONE, |_, _| {}) };
435435
let (join, tx) = JoinHandle::new();
436-
task.run_in_thread(move |_, _: Option<&Cancellable>, _| {
436+
task.run_in_thread(move |task, _: Option<&Cancellable>, _| {
437437
let res = panic::catch_unwind(panic::AssertUnwindSafe(func));
438438
let _ = tx.send(res);
439+
unsafe { ffi::g_task_return_pointer(task.to_glib_none().0, ptr::null_mut(), None) }
439440
});
440441

441442
join

0 commit comments

Comments
 (0)