[tracker] FTS libicu parser: memleak fixed



commit fb35945cb5db332229efd6f3d3977d66288f92e1
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Thu Jun 10 19:05:44 2010 +0200

    FTS libicu parser: memleak fixed

 src/libtracker-fts/tracker-parser-libicu.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-fts/tracker-parser-libicu.c b/src/libtracker-fts/tracker-parser-libicu.c
index 55151ec..ea20935 100644
--- a/src/libtracker-fts/tracker-parser-libicu.c
+++ b/src/libtracker-fts/tracker-parser-libicu.c
@@ -501,6 +501,15 @@ tracker_parser_reset (TrackerParser *parser,
 	g_free (parser->word);
 	parser->word = NULL;
 
+	if (parser->bi) {
+		ubrk_close (parser->bi);
+		parser->bi = NULL;
+	}
+	g_free (parser->utxt);
+	parser->utxt = NULL;
+	g_free (parser->offsets);
+	parser->offsets = NULL;
+
 	parser->word_position = 0;
 
 	parser->cursor = 0;
@@ -553,10 +562,14 @@ tracker_parser_reset (TrackerParser *parser,
 		           u_errorName (error));
 		/* Reset buffers */
 		g_free (parser->utxt);
-		g_free (parser->offsets);
 		parser->utxt = NULL;
+		g_free (parser->offsets);
 		parser->offsets = NULL;
 		parser->utxt_size = 0;
+		if (parser->bi) {
+			ubrk_close (parser->bi);
+			parser->bi = NULL;
+		}
 	}
 
 	/* Close converter */



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