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
This commit is contained in:
Matthias Clasen 2007-07-09 18:02:38 +00:00 committed by Matthias Clasen
parent 2f6e6f2eed
commit 9f317c9591
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2007-07-09 Matthias Clasen <mclasen@redhat.com>
* gtk/gtksearchenginesimple.c: Address some thread-safety
issues. (#452598)
2007-07-09 Matthias Clasen <mclasen@redhat.com> 2007-07-09 Matthias Clasen <mclasen@redhat.com>
* modules/printbackends/*/Makefile.am: Fix build problems * modules/printbackends/*/Makefile.am: Fix build problems

View File

@ -95,13 +95,13 @@ search_thread_data_new (GtkSearchEngineSimple *engine,
data = g_new0 (SearchThreadData, 1); data = g_new0 (SearchThreadData, 1);
data->engine = engine; data->engine = g_object_ref (engine);
uri = _gtk_query_get_location (query); uri = _gtk_query_get_location (query);
if (uri != NULL) if (uri != NULL)
{ {
data->path = g_filename_from_uri (uri, NULL, NULL); data->path = g_filename_from_uri (uri, NULL, NULL);
g_free (uri); g_free (uri);
} }`
if (data->path == NULL) if (data->path == NULL)
data->path = g_strdup (g_get_home_dir ()); data->path = g_strdup (g_get_home_dir ());
@ -117,6 +117,7 @@ search_thread_data_new (GtkSearchEngineSimple *engine,
static void static void
search_thread_data_free (SearchThreadData *data) search_thread_data_free (SearchThreadData *data)
{ {
g_object_unref (data->engine);
g_free (data->path); g_free (data->path);
g_strfreev (data->words); g_strfreev (data->words);
g_free (data); g_free (data);
@ -179,7 +180,7 @@ send_batch (SearchThreadData *data)
hits = g_new (SearchHits, 1); hits = g_new (SearchHits, 1);
hits->uris = data->uri_hits; hits->uris = data->uri_hits;
hits->thread_data = data; 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; data->uri_hits = NULL;
} }
@ -277,7 +278,7 @@ search_thread_func (gpointer user_data)
send_batch (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 */ #endif /* HAVE_FTW_H */
return NULL; return NULL;