tracker r1523 - in branches/indexer-split: . src/libtracker-db



Author: carlosg
Date: Thu May 29 09:26:12 2008
New Revision: 1523
URL: http://svn.gnome.org/viewvc/tracker?rev=1523&view=rev

Log:
2008-05-29  Carlos Garnacho  <carlos imendio com>

        * src/libtracker-db/tracker-db-interface-sqlite.c: Make sure the
        procedures table is unreferenced when setting a new one. Also, don't
        create one during initialization.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c

Modified: branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c
==============================================================================
--- branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c	(original)
+++ branches/indexer-split/src/libtracker-db/tracker-db-interface-sqlite.c	Thu May 29 09:26:12 2008
@@ -132,7 +132,10 @@
 	g_free (priv->filename);
 
 	g_hash_table_destroy (priv->statements);
-	g_hash_table_unref (priv->procedures);
+
+	if (priv->procedures) {
+		g_hash_table_unref (priv->procedures);
+	}
 
 	g_slist_foreach (priv->function_data, (GFunc) g_free, NULL);
 	g_slist_free (priv->function_data);
@@ -175,9 +178,6 @@
 
 	priv = TRACKER_DB_INTERFACE_SQLITE_GET_PRIVATE (db_interface);
 
-	priv->procedures = g_hash_table_new_full (g_str_hash, g_str_equal,
-						  (GDestroyNotify) g_free,
-						  (GDestroyNotify) g_free);
 	priv->statements = g_hash_table_new_full (g_str_hash, g_str_equal,
 						  (GDestroyNotify) g_free,
 						  (GDestroyNotify) sqlite3_finalize);
@@ -317,7 +317,15 @@
 	TrackerDBInterfaceSqlitePrivate *priv;
 
 	priv = TRACKER_DB_INTERFACE_SQLITE_GET_PRIVATE (db_interface);
-	priv->procedures = g_hash_table_ref (procedure_table);
+
+	if (priv->procedures) {
+		g_hash_table_unref (priv->procedures);
+		priv->procedures = NULL;
+	}
+
+	if (procedure_table) {
+		priv->procedures = g_hash_table_ref (procedure_table);
+	}
 }
 
 static TrackerDBResultSet *



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