From c5b21b054f6b129053dade8c5bb9ec10f27bac60 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 6 Aug 2010 04:12:52 +0000 Subject: [PATCH] MGR: Fix a bug which shut down local client even though Manager didn't launch it when Manager was connected to a remote host svn path=/trunk/boinc/; revision=22152 --- checkin_notes | 12 +++++++++++- clientgui/BOINCBaseFrame.cpp | 13 ------------- clientgui/BOINCClientManager.h | 2 -- clientgui/BOINCTaskBar.cpp | 13 ------------- clientgui/MainDocument.cpp | 9 +++++++-- 5 files changed, 18 insertions(+), 31 deletions(-) diff --git a/checkin_notes b/checkin_notes index a622b3b691..928ebda3d8 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5813,4 +5813,14 @@ Rom 5 Aug 2010 standard control there. clientgui/ - DlgEventLog.cpp \ No newline at end of file + DlgEventLog.cpp + +Charlie 5 Aug 2010 + - MGR: Fix a bug which shut down local client even though Manager didn't launch it + when Manager was connected to a remote host. + + clientgui/ + BOINCBaseFrame.cpp + BOINCClientManager.h + BOINCTaskBar.cpp + MainDocument.cpp diff --git a/clientgui/BOINCBaseFrame.cpp b/clientgui/BOINCBaseFrame.cpp index 6d07cdb476..bb49f0d818 100644 --- a/clientgui/BOINCBaseFrame.cpp +++ b/clientgui/BOINCBaseFrame.cpp @@ -333,19 +333,6 @@ void CBOINCBaseFrame::OnExit(wxCommandEvent& WXUNUSED(event)) { // Save state before exiting SaveState(); -#ifdef __WXMSW__ - CMainDocument* pDoc = wxGetApp().GetDocument(); - - wxASSERT(pDoc); - wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - - if (wxGetApp().ShouldShutdownCoreClient()) { - pDoc->m_pClientManager->EnableBOINCStartedByManager(); - } else { - pDoc->m_pClientManager->DisableBOINCStartedByManager(); - } -#endif - // Under wxWidgets 2.8.0, the task bar icons must be deleted for app to exit its main loop #ifdef __WXMAC__ wxGetApp().DeleteMacSystemMenu(); diff --git a/clientgui/BOINCClientManager.h b/clientgui/BOINCClientManager.h index 8908b92f6f..9b460c62a2 100644 --- a/clientgui/BOINCClientManager.h +++ b/clientgui/BOINCClientManager.h @@ -34,8 +34,6 @@ public: bool IsSystemBooting(); int IsBOINCConfiguredAsDaemon(); - void DisableBOINCStartedByManager() { m_bBOINCStartedByManager = false; }; - void EnableBOINCStartedByManager() { m_bBOINCStartedByManager = true; }; bool WasBOINCStartedByManager() { return m_bBOINCStartedByManager; }; bool IsBOINCCoreRunning(); diff --git a/clientgui/BOINCTaskBar.cpp b/clientgui/BOINCTaskBar.cpp index 593bd39e9e..70da0971cf 100644 --- a/clientgui/BOINCTaskBar.cpp +++ b/clientgui/BOINCTaskBar.cpp @@ -264,19 +264,6 @@ void CTaskBarIcon::OnExit(wxCommandEvent& event) { if (wxGetApp().ConfirmExit()) #endif { -#ifdef __WXMSW__ - CMainDocument* pDoc = wxGetApp().GetDocument(); - - wxASSERT(pDoc); - wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - - if (wxGetApp().ShouldShutdownCoreClient()) { - pDoc->m_pClientManager->EnableBOINCStartedByManager(); - } else { - pDoc->m_pClientManager->DisableBOINCStartedByManager(); - } -#endif - wxCloseEvent eventClose; OnClose(eventClose); if (eventClose.GetSkipped()) event.Skip(); diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 9266d9f1d0..ce89751abf 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -509,8 +509,13 @@ int CMainDocument::OnExit() { int iRetVal = 0; if (m_pClientManager) { - m_pClientManager->ShutdownBOINCCore(); - +#ifdef __WXMSW__ + if (wxGetApp().ShouldShutdownCoreClient()) +#endif + { + m_pClientManager->ShutdownBOINCCore(); + } + delete m_pClientManager; m_pClientManager = NULL; }