// DESTRUCTOR //------------------------------------------------------------------------------ Process::~Process() { if ( m_Started ) { WaitForExit(); } }
//! @brief Initializes the application. //! //! It will open the main window and connect default to server or open the connect window. bool UpdaterApp::OnInit() { //this triggers the Cli Parser amongst other stuff if (!wxApp::OnInit()) return false; if ( m_paramcount == 5) { WaitForExit(m_pid); wxArrayString params; if (!StartUpdate(TrimQuotes(m_source_dir), TrimQuotes(m_destination_dir), true)) { //update failed, try as admin params.push_back(m_source_dir); params.push_back(m_destination_dir); RunProcess(m_updater_exe, params, false, true); params.clear(); } //start springlobby return RunProcess(m_springlobby_exe, params, true); } else if (m_paramcount != 2) { return false; } return StartUpdate(TrimQuotes(m_source_dir), TrimQuotes(m_destination_dir), false); }
// /// Combines the behavior of Terminate() and /// WaitForExit(). Sets an internal flag that /// indicates that the thread should exit and blocks /// the calling thread until the internal thread /// exits or until the time specified by timeout, in /// milliseconds, expires. A timeout of NoLimit says /// to wait indefinitely. // ulong TThread::TerminateAndWait(ulong timeout) { Terminate(); return WaitForExit(timeout); }