[tracker/journal-compression] libtracker-db: Fix critical on journal reader shutdown



commit 09e83f6be37c8b5ff2271d21d16af837ec6490b0
Author: Jürg Billeter <j bitron ch>
Date:   Fri May 28 13:36:38 2010 +0200

    libtracker-db: Fix critical on journal reader shutdown

 src/libtracker-db/tracker-db-journal.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index 68e11ba..f6fa75d 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -1167,12 +1167,10 @@ reader_next_file (GError **error)
 static gboolean
 db_journal_reader_shutdown (JournalReader *jreader)
 {
-	g_return_val_if_fail (jreader->file != NULL || jreader->stream != NULL, FALSE);
-
-	if (reader.stream) {
-		g_object_unref (reader.stream);
-		reader.stream = NULL;
-	} else {
+	if (jreader->stream) {
+		g_object_unref (jreader->stream);
+		jreader->stream = NULL;
+	} else if (jreader->file) {
 #if GLIB_CHECK_VERSION(2,22,0)
 		g_mapped_file_unref (jreader->file);
 #else



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