private void InitializeDebugger(string debuggerEnginePath, string[] sources)
        {
            Action <string> loggerAction = (text) => SendEvent(new OutputEvent("stdout", text));

            _wrapper = new WinDbgWrapper(debuggerEnginePath, sources);
            _wrapper.BreakpointHit  += OnBreakpoint;
            _wrapper.ExceptionHit   += OnException;
            _wrapper.BreakHit       += OnBreak;
            _wrapper.Terminated     += OnTerminated;
            _wrapper.ProcessExited  += OnProcessExited;
            _wrapper.ThreadFinished += OnThreadFinished;
            _wrapper.ThreadStarted  += OnThreadStarted;

            _api = new DebuggerApi(_wrapper, Defaults.Timeout);
        }
        private void OnTerminated(object sender, EventArgs e)
        {
            _wrapper.BreakHit       -= OnBreak;
            _wrapper.BreakpointHit  -= OnBreakpoint;
            _wrapper.ExceptionHit   -= OnException;
            _wrapper.ProcessExited  -= OnProcessExited;
            _wrapper.Terminated     -= OnTerminated;
            _wrapper.ThreadFinished -= OnThreadFinished;
            _wrapper.ThreadStarted  -= OnThreadStarted;
            _wrapper.Dispose();

            _wrapper = null;
            _api     = null;

            SendEvent(new TerminatedEvent());
        }