summaryrefslogtreecommitdiff
path: root/gtk/gtksearchenginesimple.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2007-07-09 18:02:38 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2007-07-09 18:02:38 +0000
commit9f317c959197f5b4446f5a1e2d8611ec86073092 (patch)
treefd565511bab6a47421d3d946f0482c9fd8c45a11 /gtk/gtksearchenginesimple.c
parent2f6e6f2eede861cac2c0e906d3ee57c2e9d5ef0b (diff)
downloadgtk+-9f317c959197f5b4446f5a1e2d8611ec86073092.tar.gz
Address some thread-safety issues. (#452598)
2007-07-09 Matthias Clasen <mclasen@redhat.com> * gtk/gtksearchenginesimple.c: Address some thread-safety issues. (#452598) svn path=/trunk/; revision=18413
Diffstat (limited to 'gtk/gtksearchenginesimple.c')
-rw-r--r--gtk/gtksearchenginesimple.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gtk/gtksearchenginesimple.c b/gtk/gtksearchenginesimple.c
index a085310c4c..a0a957a16e 100644
--- a/gtk/gtksearchenginesimple.c
+++ b/gtk/gtksearchenginesimple.c
@@ -95,13 +95,13 @@ search_thread_data_new (GtkSearchEngineSimple *engine,
data = g_new0 (SearchThreadData, 1);
- data->engine = engine;
+ data->engine = g_object_ref (engine);
uri = _gtk_query_get_location (query);
if (uri != NULL)
{
data->path = g_filename_from_uri (uri, NULL, NULL);
g_free (uri);
- }
+ }`
if (data->path == NULL)
data->path = g_strdup (g_get_home_dir ());
@@ -117,6 +117,7 @@ search_thread_data_new (GtkSearchEngineSimple *engine,
static void
search_thread_data_free (SearchThreadData *data)
{
+ g_object_unref (data->engine);
g_free (data->path);
g_strfreev (data->words);
g_free (data);
@@ -179,7 +180,7 @@ send_batch (SearchThreadData *data)
hits = g_new (SearchHits, 1);
hits->uris = data->uri_hits;
hits->thread_data = data;
- g_idle_add (search_thread_add_hits_idle, hits);
+ gdk_threads_add_idle (search_thread_add_hits_idle, hits);
}
data->uri_hits = NULL;
}
@@ -277,7 +278,7 @@ search_thread_func (gpointer user_data)
send_batch (data);
- g_idle_add (search_thread_done_idle, data);
+ gdk_threads_add_idle (search_thread_done_idle, data);
#endif /* HAVE_FTW_H */
return NULL;