[nautilus] search-engine-simple: keep a reference to self in the thread data



commit 6558f0e435048cb0b05d2423e3cab9d2a99c600d
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Sep 5 17:57:30 2012 -0400

    search-engine-simple: keep a reference to self in the thread data
    
    Since we could have been unreffed when the flow reaches
    search_thread_done_idle().

 .../nautilus-search-engine-simple.c                |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-search-engine-simple.c b/libnautilus-private/nautilus-search-engine-simple.c
index 09684c3..3e6c10a 100644
--- a/libnautilus-private/nautilus-search-engine-simple.c
+++ b/libnautilus-private/nautilus-search-engine-simple.c
@@ -99,7 +99,7 @@ search_thread_data_new (NautilusSearchEngineSimple *engine,
 	
 	data = g_new0 (SearchThreadData, 1);
 
-	data->engine = engine;
+	data->engine = g_object_ref (engine);
 	data->directories = g_queue_new ();
 	data->visited = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 	uri = nautilus_query_get_location (query);
@@ -139,6 +139,8 @@ search_thread_data_free (SearchThreadData *data)
 	g_strfreev (data->words);	
 	g_list_free_full (data->mime_types, g_free);
 	g_list_free_full (data->hits, g_object_unref);
+	g_object_unref (data->engine);
+
 	g_free (data);
 }
 



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