[anjuta] language-support-vala: fix a critical warning and a memory leak



commit 334d909ffbb0d79b137ab4ed784323a5fe9dbf54
Author: Abderrahim Kitouni <a kitouni gmail com>
Date:   Sun Aug 15 16:59:35 2010 +0100

    language-support-vala: fix a critical warning and a memory leak

 plugins/language-support-vala/plugin.vala |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/plugins/language-support-vala/plugin.vala b/plugins/language-support-vala/plugin.vala
index c941187..623d9a2 100644
--- a/plugins/language-support-vala/plugin.vala
+++ b/plugins/language-support-vala/plugin.vala
@@ -86,13 +86,17 @@ public class ValaPlugin : Plugin {
 
 				parser.parse (context);
 				genie_parser.parse (context);
-				if (report.errors_found ())
+				if (report.errors_found ()) {
+					Vala.CodeContext.pop();
 					return null;
+				}
 
 				resolver.resolve (context);
-				if (report.errors_found ())
+				if (report.errors_found ()) {
+					Vala.CodeContext.pop();
 					/* TODO: there may be missing packages */
 					return null;
+				}
 
 				analyzer.analyze (context);
 
@@ -119,8 +123,10 @@ public class ValaPlugin : Plugin {
 		//debug("Deactivating ValaPlugin");
 		remove_watch(editor_watch_id, true);
 
-		context = null;
-		source_files = null;
+		lock (context) {
+			context = null;
+			source_files = null;
+		}
 
 		return true;
 	}



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