tracker r2880 - in trunk: . src/libtracker-db



Author: carlosg
Date: Thu Feb  5 12:07:16 2009
New Revision: 2880
URL: http://svn.gnome.org/viewvc/tracker?rev=2880&view=rev

Log:
2009-02-05  Carlos Garnacho  <carlos imendio com>

        * src/libtracker-db/tracker-db-index.c (indexer_update_word): Fix
        glitch in binary search.
        (tracker_db_index_flush): Break flushing when paused, so it doesn't
        try to modify the closed index.

Modified:
   trunk/ChangeLog
   trunk/src/libtracker-db/tracker-db-index.c

Modified: trunk/src/libtracker-db/tracker-db-index.c
==============================================================================
--- trunk/src/libtracker-db/tracker-db-index.c	(original)
+++ trunk/src/libtracker-db/tracker-db-index.c	Thu Feb  5 12:07:16 2009
@@ -641,7 +641,7 @@
 			}
 
 			center = (right - left) / 2;
-		} while (left < right);
+		} while (left <= right);
 
 		/* Add hits that could not be updated directly here so
 		 * they can be appended later
@@ -850,6 +850,11 @@
 
 	priv = TRACKER_DB_INDEX_GET_PRIVATE (indez);
 
+	if (priv->in_pause) {
+		g_debug ("Index was paused");
+		return 0;
+	}
+
 	if (priv->in_flush) {
 		g_debug ("Index was already in the middle of a flush");
 		return 0;
@@ -881,6 +886,10 @@
 			}
 
 			g_main_context_iteration (NULL, FALSE);
+
+			if (priv->in_pause) {
+				break;
+			}
 		}
 
 		g_list_free (keys);



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