Permalink
Browse files

Make 'Debugger', 'Process' and 'Thread' sealed.

  • Loading branch information...
1 parent e53954f commit 964779615548129d74d2c2bf5584e7bf43f122aa Martin Baulig committed Jul 31, 2010
Showing with 9 additions and 14 deletions.
  1. +2 −2 classes/Debugger.cs
  2. +1 −1 classes/Process.cs
  3. +6 −11 classes/Thread.cs
View
4 classes/Debugger.cs
@@ -20,7 +20,7 @@ namespace Mono.Debugger
public delegate void ThreadEventHandler (Debugger debugger, Thread thread);
public delegate void ProcessEventHandler (Debugger debugger, Process process);
- public class Debugger : DebuggerMarshalByRefObject
+ public sealed class Debugger : DebuggerMarshalByRefObject
{
ManualResetEvent kill_event;
DebuggerConfiguration config;
@@ -445,7 +445,7 @@ private void check_disposed ()
throw new ObjectDisposedException ("DebuggerServant");
}
- protected virtual void Dispose (bool disposing)
+ protected void Dispose (bool disposing)
{
// Check to see if Dispose has already been called.
lock (this) {
View
2 classes/Process.cs
@@ -22,7 +22,7 @@ public enum ExceptionAction
StopUnhandled = 2
}
- public class Process : DebuggerMarshalByRefObject
+ public sealed class Process : DebuggerMarshalByRefObject
{
Debugger debugger;
ProcessServant servant;
View
17 classes/Thread.cs
@@ -18,7 +18,7 @@ namespace Mono.Debugger
[Serializable]
internal delegate object TargetAccessDelegate (Thread target, object user_data);
- public class Thread : DebuggerMarshalByRefObject, IOperationHost
+ public sealed class Thread : DebuggerMarshalByRefObject, IOperationHost
{
[Flags]
public enum Flags {
@@ -791,15 +791,7 @@ protected void check_disposed ()
throw new ObjectDisposedException ("Thread");
}
- protected virtual void DoDispose ()
- {
- if (servant != null) {
- servant.Dispose ();
- servant = null;
- }
- }
-
- protected virtual void Dispose (bool disposing)
+ protected void Dispose (bool disposing)
{
// Check to see if Dispose has already been called.
if (disposed)
@@ -809,7 +801,10 @@ protected virtual void Dispose (bool disposing)
// If this is a call to Dispose, dispose all managed resources.
if (disposing) {
- DoDispose ();
+ if (servant != null) {
+ servant.Dispose ();
+ servant = null;
+ }
}
}

0 comments on commit 9647796

Please sign in to comment.