[gedit-code-assistance] Fixed crash in async threads for rescanning makefile



commit 7a11a7b34ce346f7b0cc917e8cba09d925c781f9
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Sun Nov 13 19:18:20 2011 +0100

    Fixed crash in async threads for rescanning makefile

 src/gcp-c-compile-args.vala |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/gcp-c-compile-args.vala b/src/gcp-c-compile-args.vala
index ac95b9d..3f244a3 100644
--- a/src/gcp-c-compile-args.vala
+++ b/src/gcp-c-compile-args.vala
@@ -426,7 +426,7 @@ namespace Gcp.C
 			return filter_flags(makefile, source, retargs);
 		}
 
-		private void on_makefile_changed(Makefile makefile)
+		private async void makefile_changed_async(Makefile makefile)
 		{
 			ThreadFunc<void *> func = () => {
 				foreach (File file in makefile.sources)
@@ -440,12 +440,18 @@ namespace Gcp.C
 			try
 			{
 				Thread.create<void *>(func, false);
+				yield;
 			}
 			catch
 			{
 			}
 		}
 
+		private void on_makefile_changed(Makefile makefile)
+		{
+			makefile_changed_async.begin(makefile);
+		}
+
 		private void find_for_makefile(File makefile, File file)
 		{
 			string target;



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