void Driver::MainLoop () { SBEvent event; while (!GetIsDone()) { m_listener->WaitForEvent (UINT32_MAX, event); if (event.IsValid()) { ProcessEvent(event); } } DestroyPseudoTerminal(); CloseIOChannelFile (); if (!iochannel_thread_exited) { event.Clear(); m_listener->GetNextEventForBroadcasterWithType (*m_io_channel_ap, IOChannel::eBroadcastBitThreadDidExit, event); if (!event.IsValid()) { // Send end EOF to the driver file descriptor m_io_channel_ap->Stop(); } } SBDebugger::Destroy (m_debugger); }