Skip to content

Commit

Permalink
file-transfer: return a value from task
Browse files Browse the repository at this point in the history
- This fixes "GTask finalized without ever returning (using g_task_return_*()).
This potentially indicates a bug in the program." errors.
  • Loading branch information
hfiguiere committed Oct 11, 2023
1 parent 3a2a666 commit 11d2b5e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions document-portal/file-transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,14 +566,17 @@ stop_file_transfers_in_thread_func (GTask *task,
}
}
G_UNLOCK (transfers);
g_task_return_boolean (task, TRUE);
}

void
stop_file_transfers_for_sender (const char *sender)
{
GTask *task;
g_autofree char *name = g_strdup_printf("stop_file_transfers_for_sender(%s)", sender);

task = g_task_new (NULL, NULL, NULL, NULL);
g_task_set_name (task, name);
g_task_set_task_data (task, g_strdup (sender), g_free);
g_task_run_in_thread (task, stop_file_transfers_in_thread_func);
g_object_unref (task);
Expand Down

0 comments on commit 11d2b5e

Please sign in to comment.