diff --git a/checkin_notes b/checkin_notes index b6b8a8fea1..d1518a485d 100755 --- a/checkin_notes +++ b/checkin_notes @@ -22125,10 +22125,16 @@ Rom 6 Jan 2005 populate the regular tooltip field as it will appear before the bubble request and makes the taskbar applet appear ugly + - Bug Fix: The new gui should enforce closing down the core client + when it launches the core client, we were using the wxWidget + framework to do this, but the call to wxProcess::Exists causes + an assert on Windows if the process doesn't exist. And sometimes + crashes in a release build. client/win/ wingui_mainwindow.cpp clientgui/ + BOINCGUIApp.cpp, .h BOINCBaseView.cpp ViewMessages.cpp ViewProjects.cpp diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 329cd707bf..27e7628f98 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -50,7 +50,8 @@ bool CBOINCGUIApp::OnInit() // Setup variables with default values m_bBOINCStartedByManager = false; m_bFrameVisible = true; - m_lBOINCCoreProccessId = 0; + m_lBOINCCoreProcessId = 0; + m_hBOINCCoreProcess = NULL; // Enable Trace Masks //wxLog::AddTraceMask( wxT("Function Start/End") ); @@ -287,7 +288,8 @@ void CBOINCGUIApp::StartupBOINCCore() ); if (bProcessStarted) { - m_lBOINCCoreProccessId = pi.dwProcessId; + m_lBOINCCoreProcessId = pi.dwProcessId; + m_hBOINCCoreProcess = pi.hProcess; } #else @@ -298,7 +300,7 @@ void CBOINCGUIApp::StartupBOINCCore() #endif - if ( 0 != m_lBOINCCoreProccessId ) + if ( 0 != m_lBOINCCoreProcessId ) m_bBOINCStartedByManager = true; } } @@ -311,23 +313,27 @@ void CBOINCGUIApp::ShutdownBOINCCore() if ( m_bBOINCStartedByManager ) { - if ( wxProcess::Exists( m_lBOINCCoreProccessId ) ) + if ( wxProcess::Exists( m_lBOINCCoreProcessId ) ) { m_pDocument->CoreClientQuit(); -/* for ( iCount = 0; iCount <= 10; iCount++ ) { - if ( !bClientQuit && !wxProcess::Exists( m_lBOINCCoreProccessId ) ) +#ifdef __WXMSW__ + DWORD dwExitCode; + if ( !bClientQuit && GetExitCodeProcess( m_hBOINCCoreProcess, &dwExitCode ) ) { - bClientQuit = true; - continue; + if ( STILL_ACTIVE != dwExitCode ) + { + bClientQuit = true; + continue; + } } +#endif ::wxSleep(1); } if ( !bClientQuit ) - ::wxKill( m_lBOINCCoreProccessId ); -*/ + ::wxKill( m_lBOINCCoreProcessId ); } } } diff --git a/clientgui/BOINCGUIApp.h b/clientgui/BOINCGUIApp.h index cc1aca0c0f..e78036651a 100644 --- a/clientgui/BOINCGUIApp.h +++ b/clientgui/BOINCGUIApp.h @@ -68,9 +68,10 @@ protected: bool m_bBOINCStartedByManager; bool m_bFrameVisible; - long m_lBOINCCoreProccessId; + long m_lBOINCCoreProcessId; #ifdef __WXMSW__ + HANDLE m_hBOINCCoreProcess; HINSTANCE m_hIdleDll; #endif