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



commit c6759d83503ec20f7c88430591d0475da7a5f77e
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]