[rhythmbox] rhythmdb: free library locations later



commit f02936ca4d516bbdafb0c5dae63092f9842b6891
Author: Jonathan Matthew <jonathan d14n org>
Date:   Wed Sep 19 08:28:16 2012 +1000

    rhythmdb: free library locations later
    
    Various bits of rhythmdb use the library locations array, so we
    should free it as late as possible to help them avoid crashing.

 rhythmdb/rhythmdb.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/rhythmdb/rhythmdb.c b/rhythmdb/rhythmdb.c
index 6c52d79..eca2ea3 100644
--- a/rhythmdb/rhythmdb.c
+++ b/rhythmdb/rhythmdb.c
@@ -1008,9 +1008,6 @@ rhythmdb_shutdown (RhythmDB *db)
 	action->type = RHYTHMDB_ACTION_QUIT;
 	g_async_queue_push (db->priv->action_queue, action);
 
-	g_strfreev (db->priv->library_locations);
-	db->priv->library_locations = NULL;
-
 	/* abort all async io operations */
 	g_mutex_lock (&db->priv->stat_mutex);
 	g_list_foreach (db->priv->outstanding_stats, (GFunc)_shutdown_foreach_swapped, db);
@@ -1104,6 +1101,8 @@ rhythmdb_finalize (GObject *object)
 	g_return_if_fail (db->priv != NULL);
 
 	rhythmdb_finalize_monitoring (db);
+	g_strfreev (db->priv->library_locations);
+	db->priv->library_locations = NULL;
 
 	g_thread_pool_free (db->priv->query_thread_pool, FALSE, TRUE);
 	g_async_queue_unref (db->priv->action_queue);



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