summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-12-18 18:00:04 +0100
committerCarlos Soriano <csoriano@gnome.org>2015-12-18 20:56:18 +0100
commitec05b0a28e07b8b7b3e5d5e23563c504e180cbef (patch)
treeda2dffcea110de317044dcfea6846d5a3bd87e1c
parentd81d6bae238be5b91e9027a9655b27c7fce7ee45 (diff)
downloadnautilus-ec05b0a28e07b8b7b3e5d5e23563c504e180cbef.tar.gz
directory-async: don't modify priv data on cancelled
What we are doing: Directory starts io. It cancels the cancellables associated to each async operation. It starts new operations. When the new operation finishes, either because it's cancelled or because it successfully finished, it modifies the directory private data and sets its associated cancellable as NULL to indicate the directory that it's all done, so the directory just checks for the cancellables in its private data to know if there is some operation going on. However, what can happens is: Directory starts io. It cancels the cancellables and sets as null to start a new operation. It starts a new operation. The old operation finishes cancelled, and sets as null the private cancellable of the directory. Now the directory thinks there is no operation going on, but actually the new operation is still going on. The directory starts io and checks if there is something to stop, but sees there is no cancellable and keeps going. Then the new operation finishes and hits an assert when realizes that the directory state is inconsistent. To fix this, don't set as null the cancellable in the private data of the directory when the operation has been cancelled. It's okay to set as null when the operation finishes succesfully, since it's ensured that only one operation can be running withouth being cancelled. https://bugzilla.gnome.org/show_bug.cgi?id=759608
-rw-r--r--libnautilus-private/nautilus-directory-async.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/libnautilus-private/nautilus-directory-async.c b/libnautilus-private/nautilus-directory-async.c
index ba58ebf2b..fd70c7b28 100644
--- a/libnautilus-private/nautilus-directory-async.c
+++ b/libnautilus-private/nautilus-directory-async.c
@@ -2337,7 +2337,6 @@ count_more_files_callback (GObject *source_object,
if (g_cancellable_is_cancelled (state->cancellable)) {
/* Operation was cancelled. Bail out */
- directory->details->count_in_progress = NULL;
async_job_end (directory, "directory count");
nautilus_directory_async_state_changed (directory);
@@ -2391,7 +2390,6 @@ count_children_callback (GObject *source_object,
if (g_cancellable_is_cancelled (state->cancellable)) {
/* Operation was cancelled. Bail out */
directory = state->directory;
- directory->details->count_in_progress = NULL;
async_job_end (directory, "directory count");
nautilus_directory_async_state_changed (directory);