public void Disconnect( ) { lock ( sync ) { if ( stack != IntPtr.Zero ) { Internals.GhostAPI.GhClose( stack ); stack = IntPtr.Zero; } } }