GIOScheduler: Fix access after free in "cancelled" handler

* GCancellable can be "cancelled" more than once if
   g_cancellable_reset() is called.
 * Don't assume that because the "cancelled" signal fired
   it won't fire again.

https://bugzilla.gnome.org/show_bug.cgi?id=680111
This commit is contained in:
Stef Walter 2012-07-17 18:34:16 +02:00 committed by Matthias Clasen
parent e97a4c7e5e
commit a0b71839ee

View File

@ -130,8 +130,8 @@ on_job_canceled (GCancellable *cancellable,
{
GIOSchedulerJob *job = user_data;
/* This might be called more than once */
job->io_priority = -1;
job->cancellable_id = 0;
if (job_thread_pool != NULL)
g_thread_pool_set_sort_function (job_thread_pool,