[nautilus/gnome-3-30] search-engine-recent: Avoid premature destruction



commit aaba2b937f7bf6e26d7acbb8a98b185bd6b83c15
Author: António Fernandes <antoniof gnome org>
Date:   Sat Oct 13 21:39:46 2018 +0000

    search-engine-recent: Avoid premature destruction
    
    Since commit 4c6d4eea995a66e80fb21ee83b66954d1ce71c08, we haven't been
    increasing the reference count of the recent search engine when not
    creating a thread.
    
    But the idle callback unref's it regardless, which causes the recent
    engine object to be destroyed while NautilusSearchEngine still holds
    a  reference to it. This causes a crash when trying to stop the
    already destroyed recent engine.
    
    Restore reference count increase to fix this.
    
    Fixes https://gitlab.gnome.org/GNOME/nautilus/issues/692
    
    
    (cherry picked from commit 3eecada7ad7db8d66be24cfc4ba6677e33c7d6e1)

 src/nautilus-search-engine-recent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/nautilus-search-engine-recent.c b/src/nautilus-search-engine-recent.c
index 8cc7b88f0..d265c1716 100644
--- a/src/nautilus-search-engine-recent.c
+++ b/src/nautilus-search-engine-recent.c
@@ -339,7 +339,7 @@ nautilus_search_engine_recent_start (NautilusSearchProvider *provider)
                               nautilus_query_get_recursive (self->query),
                               location))
     {
-        search_add_hits_idle (self, NULL);
+        search_add_hits_idle (g_object_ref (self), NULL);
         return;
     }
 


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