Browse Source

Fixed NullReferenceException in unit tests pad when SharpDevelop was closed while the parser thread was still running.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4685 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 16 years ago
parent
commit
225e5bdcc5
  1. 14
      src/AddIns/Misc/UnitTesting/Src/UnitTestsPad.cs

14
src/AddIns/Misc/UnitTesting/Src/UnitTestsPad.cs

@ -116,10 +116,14 @@ namespace ICSharpCode.UnitTesting @@ -116,10 +116,14 @@ namespace ICSharpCode.UnitTesting
/// </summary>
protected void SolutionLoaded(Solution solution)
{
if (solution != null) {
treeView.AddSolution(solution);
} else {
treeView.Clear();
// SolutionLoaded will be invoked from another thread.
// The UnitTestsPad might be disposed by the time the event is processed by the main thread.
if (treeView != null) {
if (solution != null) {
treeView.AddSolution(solution);
} else {
treeView.Clear();
}
}
}
@ -233,7 +237,7 @@ namespace ICSharpCode.UnitTesting @@ -233,7 +237,7 @@ namespace ICSharpCode.UnitTesting
}
/// <summary>
/// Indicates that an event handler for the ParserService's
/// Indicates that an event handler for the ParserService's
/// LoadSolutionProjectsThreadEnded event has been added
/// </summary>
protected virtual void OnAddedLoadSolutionProjectsThreadEndedHandler()

Loading…
Cancel
Save