[tracker/tracker-0.6] Fixed critical warning calling TrackerProcessor API before created



commit 2904f913183e4be05d8c3cc74645dee58ae35d12
Author: Martyn Russell <martyn imendio com>
Date:   Mon Jun 1 12:04:50 2009 +0100

    Fixed critical warning calling TrackerProcessor API before created
    
    This fixes:
    
      Tracker-Critical **: tracker_processor_mount_point_added assertion
      `TRACKER_IS_PROCESSOR (processor)' failed
    
    Which could occur because TrackerProcessor wasn't created at the time
    of calling during startup of the daemon. This was a race condition.
---
 src/trackerd/tracker-main.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/trackerd/tracker-main.c b/src/trackerd/tracker-main.c
index c20361d..cfddeb4 100644
--- a/src/trackerd/tracker-main.c
+++ b/src/trackerd/tracker-main.c
@@ -772,9 +772,15 @@ mount_point_set_cb (DBusGProxy *proxy,
 	 * processor checks state and at the time, we are PAUSED which
 	 * causes us state machine problems. 
 	 *
+	 * We check the processor is created here because there is a
+	 * race condition where the processor isn't created yet and we
+	 * tell it about added/removed mount points. It will
+	 * automatically find those out when it is created, it is only
+	 * needed here for AFTER it is created.
+	 *
 	 * This is the easiest way to do it.
 	 */
-	if (!mpu->no_crawling) {
+	if (!mpu->no_crawling && private->processor) {
 		if (mpu->was_added) {
 			tracker_processor_mount_point_added (private->processor,
 							     mpu->udi,



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