[nautilus] directory-async: set NULL the count progress on cancel



commit 764958a19ac8c83d0399455b0657f0c1d480f396
Author: Carlos Soriano <csoriano gnome org>
Date:   Mon Dec 14 19:11:17 2015 +0100

    directory-async: set NULL the count progress on cancel
    
    When a file gets moved, nautilus directory cancel the loading of
    the attributes of that file, in case that file is in the work queue
    of that directory, since it will move to another directory.
    
    For that, we cancel the cancellable associated to the async request
    of the attributes of that file.
    
    However, since this is threaded, if some client of the directory kick of
    I/O with the nautilus_directory_async_state_changed and the cancellable
    didn't reach the callback, the file attributes are still going on, and
    we reach an assert when trying to stop them again, since the file
    requesting for those attributes is no longer the one we want to stop
    loading.
    
    This was causing problems when the race kicks in, for example, the
    move to context menu action.
    
    To fix it, apart of cancel the cancellable associated, set the directory
    private data files as null, to avoid trying to stop the already stopped
    request.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756253

 libnautilus-private/nautilus-directory-async.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-directory-async.c b/libnautilus-private/nautilus-directory-async.c
index 5181f48..ba58ebf 100644
--- a/libnautilus-private/nautilus-directory-async.c
+++ b/libnautilus-private/nautilus-directory-async.c
@@ -478,6 +478,7 @@ directory_count_cancel (NautilusDirectory *directory)
 {
        if (directory->details->count_in_progress != NULL) {
                g_cancellable_cancel (directory->details->count_in_progress->cancellable);
+               directory->details->count_in_progress = NULL;
        }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]