[tracker/async-queries-due] tracker-db-manager: Add NULL check when destroying thread/iface hashtable.



commit edab3570cac9aec3ecd3d5398741a623a29084c0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Apr 16 16:18:30 2010 +0200

    tracker-db-manager: Add NULL check when destroying thread/iface hashtable.
    
    tracker_db_manager_init() may return early in some circumstances, not creating
    the hashtable.

 src/libtracker-db/tracker-db-manager.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-manager.c b/src/libtracker-db/tracker-db-manager.c
index 9c008ba..a184887 100644
--- a/src/libtracker-db/tracker-db-manager.c
+++ b/src/libtracker-db/tracker-db-manager.c
@@ -939,8 +939,10 @@ tracker_db_manager_shutdown (void)
 
 	g_static_private_free (&interface_data_key);
 
-	g_hash_table_destroy (thread_ifaces);
-	thread_ifaces = NULL;
+	if (thread_ifaces) {
+		g_hash_table_destroy (thread_ifaces);
+		thread_ifaces = NULL;
+	}
 
 	/* Since we don't reference this enum anywhere, we do
 	 * it here to make sure it exists when we call



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