From 8310575fc3851f8d91a68e0ec238dd37e4177fed Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 3 Jul 2013 17:15:30 -0500 Subject: [PATCH] added LLProgressView::abortShowProgress. Issue upon failed login to terminate pending loginpanel destruction which was killing the actual 'new' replacement loginpanel instead of the old to-be-deleted version. --- indra/newview/llpanellogin.cpp | 11 ++--------- indra/newview/llprogressview.cpp | 8 ++++++++ indra/newview/llprogressview.h | 1 + indra/newview/llviewerwindow.cpp | 8 ++++++++ indra/newview/llviewerwindow.h | 1 + 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 0986ac024..440b83b0d 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -216,15 +216,8 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, setBackgroundVisible(FALSE); setBackgroundOpaque(TRUE); - // instance management - if (LLPanelLogin::sInstance) - { - LL_WARNS("AppInit") << "Duplicate instance of login view deleted" << LL_ENDL; - // Don't leave bad pointer in gFocusMgr - gFocusMgr.setDefaultKeyboardFocus(NULL); - - delete LLPanelLogin::sInstance; - } + gViewerWindow->abortShowProgress(); //Kill previous instance. It might still be alive, and if so, its probably pending + //deletion via the progressviews idle callback. Kill it now and unregister said idle callback. LLPanelLogin::sInstance = this; diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 394dfce31..cbaa5d47e 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -134,6 +134,14 @@ void LLProgressView::revealIntroPanel() mFadeFromLoginTimer.start(); gIdleCallbacks.addFunction(onIdle, this); } + +void LLProgressView::abortShowProgress() +{ + mFadeFromLoginTimer.stop(); + LLPanelLogin::close(); + gIdleCallbacks.deleteFunction(onIdle, this); +} + void LLProgressView::setStartupComplete() { mStartupComplete = true; diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index bff970e29..816305efd 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -62,6 +62,7 @@ public: void setMessage(const std::string& msg); void revealIntroPanel(); + void abortShowProgress(); void setStartupComplete(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 6a1cf636a..ca054bae3 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -5154,6 +5154,14 @@ void LLViewerWindow::revealIntroPanel() } } +void LLViewerWindow::abortShowProgress() +{ + if (mProgressView) + { + mProgressView->abortShowProgress(); + } +} + void LLViewerWindow::setShowProgress(const BOOL show) { if (mProgressView) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 9d47812d9..3b38f450d 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -280,6 +280,7 @@ public: void setProgressCancelButtonVisible( BOOL b, const std::string& label = LLStringUtil::null ); LLProgressView *getProgressView() const; void revealIntroPanel(); + void abortShowProgress(); void setStartupComplete(); void updateObjectUnderCursor();