[tracker/rss-enclosures] tracker-extract: NB#183307, Crash in quit_timeout_cb when signal_handler calls it



commit a966bd90e7a1cff74d9a0d1f52c4b322b1d617f6
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Aug 4 13:09:35 2010 +0200

    tracker-extract: NB#183307, Crash in quit_timeout_cb when signal_handler calls it

 src/tracker-extract/tracker-main.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-extract/tracker-main.c b/src/tracker-extract/tracker-main.c
index 2640931..558af19 100644
--- a/src/tracker-extract/tracker-main.c
+++ b/src/tracker-extract/tracker-main.c
@@ -119,7 +119,9 @@ quit_timeout_cb (gpointer user_data)
 	quit_timeout_id = 0;
 
 	if (!disable_shutdown) {
-		g_main_loop_quit (main_loop);
+		if (main_loop) {
+			g_main_loop_quit (main_loop);
+		}
 	} else {
 		g_debug ("Would have quit the mainloop");
 	}
@@ -201,7 +203,6 @@ signal_handler (int signo)
 		in_loop = TRUE;
 		disable_shutdown = FALSE;
 		quit_timeout_cb (NULL);
-
 		/* Fall through */
 	default:
 		if (g_strsignal (signo)) {
@@ -334,6 +335,7 @@ main (int argc, char *argv[])
 	GError         *error = NULL;
 	TrackerExtract *object;
 	gchar          *log_filename = NULL;
+	GMainLoop      *my_main_loop;
 
 	bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -466,7 +468,10 @@ main (int argc, char *argv[])
 	main_loop = g_main_loop_new (NULL, FALSE);
 	tracker_main_quit_timeout_reset ();
 	g_main_loop_run (main_loop);
-	g_main_loop_unref (main_loop);
+
+	my_main_loop = main_loop;
+	main_loop = NULL;
+	g_main_loop_unref (my_main_loop);
 
 	g_message ("Shutdown started");
 



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