Index: camel/camel-filter-search.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-filter-search.c,v
retrieving revision 1.54
diff -u -p -r1.54 camel-filter-search.c
--- camel/camel-filter-search.c	20 Apr 2006 17:52:34 -0000	1.54
+++ camel/camel-filter-search.c	29 Aug 2006 20:04:33 -0000
@@ -533,7 +533,6 @@ child_watch (GPid     pid,
 	g_spawn_close_pid (pid);
 
 	child_watch_data->child_status = status;
-
 	g_main_loop_quit (child_watch_data->loop);
 }
 
@@ -549,6 +548,7 @@ run_command (struct _ESExp *f, int argc,
 	GPtrArray *args;
 	child_watch_data_t child_watch_data;
 	GSource *source;
+	GMainContext *context;
 	
 	if (argc < 1 || argv[0]->value.string[0] == '\0')
 		return 0;
@@ -590,7 +590,9 @@ run_command (struct _ESExp *f, int argc,
 	camel_stream_flush (stream);
 	camel_object_unref (stream);
 	
-	child_watch_data.loop = g_main_loop_new (g_main_context_new (), FALSE);
+	context = g_main_context_new ();
+	child_watch_data.loop = g_main_loop_new (context, FALSE);
+	g_main_context_unref (context);
 
 	source = g_child_watch_source_new (child_pid);
 	g_source_set_callback (source, (GSourceFunc) child_watch, &child_watch_data, NULL);
Index: camel/camel-filter-driver.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-filter-driver.c,v
retrieving revision 1.96
diff -u -p -r1.96 camel-filter-driver.c
--- camel/camel-filter-driver.c	12 Apr 2006 19:14:13 -0000	1.96
+++ camel/camel-filter-driver.c	29 Aug 2006 20:04:33 -0000
@@ -715,6 +715,7 @@ pipe_to_system (struct _ESExp *f, int ar
 	GPtrArray *args;
 	child_watch_data_t child_watch_data;
 	GSource *source;
+	GMainContext *context;
 	
 	if (argc < 1 || argv[0]->value.string[0] == '\0')
 		return 0;
@@ -802,7 +803,9 @@ pipe_to_system (struct _ESExp *f, int ar
 	camel_object_unref (parser);
 	
  wait:
-	child_watch_data.loop = g_main_loop_new (g_main_context_new (), FALSE);
+	context = g_main_context_new ();
+	child_watch_data.loop = g_main_loop_new (context, FALSE);
+	g_main_context_unref (context);
 
 	source = g_child_watch_source_new (child_pid);
 	g_source_set_callback (source, (GSourceFunc) child_watch, &child_watch_data, NULL);
