Commit 7421a81f authored by Emmanuele Bassi's avatar Emmanuele Bassi Committed by Emmanuele Bassi

Fixes for bug #480123.

2007-09-25  Emmanuele Bassi  <ebassi@gnome.org>

	Fixes for bug #480123.

	* gtk/gtksearchenginesimple.c:
	(gtk_search_engine_simple_dispose), (search_thread_done_idle): Cancel
	the file tree walking thread when disposing the search engine
	implementation.

	* gtk/gtkfilechooserdefault.c (search_stop_searching): Forcibly
	stop the search engine implementation when stopping the search,
	instead of just unreffing the object.

svn path=/trunk/; revision=18865
parent 37c5790a
2007-09-25 Emmanuele Bassi <ebassi@gnome.org>
Fixes for bug #480123.
* gtk/gtksearchenginesimple.c:
(gtk_search_engine_simple_dispose), (search_thread_done_idle): Cancel
the file tree walking thread when disposing the search engine
implementation.
* gtk/gtkfilechooserdefault.c (search_stop_searching): Forcibly
stop the search engine implementation when stopping the search,
instead of just unreffing the object.
2007-09-24 Kristian Rietveld <kris@imendio.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): add extra NULL check
......
......@@ -8994,6 +8994,8 @@ search_stop_searching (GtkFileChooserDefault *impl,
if (impl->search_engine)
{
_gtk_search_engine_stop (impl->search_engine);
g_object_unref (impl->search_engine);
impl->search_engine = NULL;
}
......
......@@ -72,19 +72,27 @@ struct _GtkSearchEngineSimplePrivate
G_DEFINE_TYPE (GtkSearchEngineSimple, _gtk_search_engine_simple, GTK_TYPE_SEARCH_ENGINE);
static void
finalize (GObject *object)
gtk_search_engine_simple_dispose (GObject *object)
{
GtkSearchEngineSimple *simple;
GtkSearchEngineSimplePrivate *priv;
simple = GTK_SEARCH_ENGINE_SIMPLE (object);
priv = simple->priv;
if (simple->priv->query)
if (priv->query)
{
g_object_unref (priv->query);
priv->query = NULL;
}
if (priv->active_search)
{
g_object_unref (simple->priv->query);
simple->priv->query = NULL;
priv->active_search->cancelled = TRUE;
priv->active_search = NULL;
}
G_OBJECT_CLASS (_gtk_search_engine_simple_parent_class)->finalize (object);
G_OBJECT_CLASS (_gtk_search_engine_simple_parent_class)->dispose (object);
}
static SearchThreadData *
......@@ -131,12 +139,10 @@ search_thread_done_idle (gpointer user_data)
data = user_data;
if (!data->cancelled)
{
_gtk_search_engine_finished (GTK_SEARCH_ENGINE (data->engine));
data->engine->priv->active_search = NULL;
}
if (!data->cancelled)
_gtk_search_engine_finished (GTK_SEARCH_ENGINE (data->engine));
data->engine->priv->active_search = NULL;
search_thread_data_free (data);
return FALSE;
......@@ -181,6 +187,7 @@ send_batch (SearchThreadData *data)
hits = g_new (SearchHits, 1);
hits->uris = data->uri_hits;
hits->thread_data = data;
gdk_threads_add_idle (search_thread_add_hits_idle, hits);
}
data->uri_hits = NULL;
......@@ -349,7 +356,7 @@ _gtk_search_engine_simple_class_init (GtkSearchEngineSimpleClass *class)
GtkSearchEngineClass *engine_class;
gobject_class = G_OBJECT_CLASS (class);
gobject_class->finalize = finalize;
gobject_class->dispose = gtk_search_engine_simple_dispose;
engine_class = GTK_SEARCH_ENGINE_CLASS (class);
engine_class->set_query = gtk_search_engine_simple_set_query;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment