[anjuta] python: Fixed a couple of memleaks in indentation code



commit 0f2cdd0b911c55a6fc32ce61d8c2bc366e64ccd2
Author: Johannes Schmid <jhs gnome org>
Date:   Wed Feb 16 22:01:36 2011 +0100

    python: Fixed a couple of memleaks in indentation code

 .../language-support-python/python-indentation.c   |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/plugins/language-support-python/python-indentation.c b/plugins/language-support-python/python-indentation.c
index 5d75501..a98bff3 100644
--- a/plugins/language-support-python/python-indentation.c
+++ b/plugins/language-support-python/python-indentation.c
@@ -617,7 +617,11 @@ get_current_statement (IAnjutaEditor *editor, gint line_num)
 	while (g_ascii_isspace (point_ch) && point_ch != '\n');
 
 	if (!ianjuta_iterable_previous (iter, NULL))
-		return "";
+	{
+		g_object_unref (iter);
+		g_string_free (statement, TRUE);
+		return g_strdup("");
+	}
 
 	do
 	{
@@ -652,6 +656,7 @@ get_last_char (IAnjutaEditor *editor, gint line_num, gint *found_line_num)
 	while (point_ch == ' ' || point_ch == '\n' || point_ch == '\r' || point_ch == '\t'); // Whitespace
 
 	*found_line_num = ianjuta_editor_get_line_from_position (editor, iter, NULL);
+	g_object_unref (iter);
 	return point_ch;
 }
 



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