private unsafe void DisposeContext() { if (_context != null) { PubSub.UnSubscribeToTerminate(_context, _terminateEventHandlerDelegate); PubSub.UnSubscribeToErrorInfo(_context, _errorInfoEventHandlerDelegate); NativeMethods.freerdp_context_free(_freerdp); _context = null; } }