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

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

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

Loading…
Cancel
Save