From ab04d935e8f3e108edec0d64c0a8538c6d5c9610 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 19 Sep 2008 07:40:39 +0000 Subject: [PATCH] Mgr: ignore timer events during RPC Wait dialog to prevent unintended recursion and crashes svn path=/trunk/boinc/; revision=16025 --- checkin_notes | 3 ++- clientgui/sg_BoincSimpleGUI.cpp | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 3d437c5d6d..8c2e2deae6 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7557,7 +7557,7 @@ David 18 Sept 2008 clientgui/ AsyncRPC.cpp,h -Charlie 18 Sep 2008 +Charlie 19 Sep 2008 Mgr: The system handles timer events during modal dialogs, such as while the RPC Wait dialog is shown. This may cause unintended recursion and repeatedly posting the same RPC requests from @@ -7567,3 +7567,4 @@ Charlie 18 Sep 2008 clientgui/ BOINCBaseFrame.cpp MainDocument.cpp,.h + sg_BoincSimpleGUI.cpp diff --git a/clientgui/sg_BoincSimpleGUI.cpp b/clientgui/sg_BoincSimpleGUI.cpp index 59d0c57289..54e954e03c 100644 --- a/clientgui/sg_BoincSimpleGUI.cpp +++ b/clientgui/sg_BoincSimpleGUI.cpp @@ -547,6 +547,13 @@ void CSimplePanel::OnProjectsAttachToProject() { // called from CSimpleFrame::OnRefreshView() void CSimplePanel::OnFrameRender() { CMainDocument* pDoc = wxGetApp().GetDocument(); + wxASSERT(pDoc); + + // OnFrameRender() may be called while SimpleGUI initialization is + // in progress due to completion of a periodic get_messages RPC, + // causing unintended recursion in CMainDocument::RequestRPC(). + // Check for that situation here. + if (pDoc->WaitingForRPC()) return; if (IsShown()) {