Browse Source

fixed threading bug in QueryCompiler

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3941 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 17 years ago
parent
commit
2e8f6fdd4d
  1. 2
      src/AddIns/Misc/Profiler/Controller/Queries/QueryCompiler.cs
  2. 3
      src/AddIns/Misc/Profiler/Frontend/Controls/QueryView.xaml.cs

2
src/AddIns/Misc/Profiler/Controller/Queries/QueryCompiler.cs

@ -76,6 +76,7 @@ namespace ICSharpCode.Profiler.Controller.Queries @@ -76,6 +76,7 @@ namespace ICSharpCode.Profiler.Controller.Queries
if (string.IsNullOrEmpty(this.currentQuery))
return false;
lock (queryCache) {
if (!queryCache.ContainsKey(this.currentQuery)) {
string code = text + PreprocessString(currentQuery) + textEnd;
CompilerResults results = csc.CompileAssemblyFromSource(GetParameters(), code);
@ -88,6 +89,7 @@ namespace ICSharpCode.Profiler.Controller.Queries @@ -88,6 +89,7 @@ namespace ICSharpCode.Profiler.Controller.Queries
} else {
report(new List<CompilerError>().AsEnumerable()); // clear errors list
}
}
return true;
}

3
src/AddIns/Misc/Profiler/Frontend/Controls/QueryView.xaml.cs

@ -148,9 +148,10 @@ namespace ICSharpCode.Profiler.Controls @@ -148,9 +148,10 @@ namespace ICSharpCode.Profiler.Controls
layer.Add(ad);
int rangeStart = RangeStart;
int rangeEnd = RangeEnd;
string query = this.CurrentQuery;
ProfilingDataProvider provider = Provider;
QueryCompiler compiler = new QueryCompiler(Reporter, this.CurrentQuery);
QueryCompiler compiler = new QueryCompiler(Reporter, query);
ringDiagram.SelectedRoot = null;
task.Execute(() => LoadWorker(provider, compiler, rangeStart, rangeEnd),

Loading…
Cancel
Save