diff --git a/Contexts/ImpersonationHandle.cs b/Contexts/ImpersonationHandle.cs index 752e665..56ff7aa 100644 --- a/Contexts/ImpersonationHandle.cs +++ b/Contexts/ImpersonationHandle.cs @@ -24,6 +24,7 @@ namespace NSspi.Contexts internal ImpersonationHandle(ServerContext server) { this.server = server; + this.disposed = false; } ~ImpersonationHandle() @@ -39,7 +40,7 @@ namespace NSspi.Contexts protected virtual void Dispose( bool disposing ) { - if( disposing && this.server != null && this.server.Disposed == false ) + if( disposing && this.disposed == false && this.server != null && this.server.Disposed == false ) { this.server.RevertImpersonate(); }