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
This commit is contained in:
Charlie Fenton 2010-08-06 04:12:52 +00:00
parent 1a7170593f
commit c5b21b054f
5 changed files with 18 additions and 31 deletions

View File

@ -5813,4 +5813,14 @@ Rom 5 Aug 2010
standard control there.
clientgui/
DlgEventLog.cpp
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

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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;
}