diff options
author | Armin Weatherwax | 2010-06-11 14:37:26 +0200 |
---|---|---|
committer | Jacek Antonelli | 2010-06-19 02:43:36 -0500 |
commit | ca719a0f68a7e7cefc4be173db0ced920e02f647 (patch) | |
tree | 7ccf941306a0954ef935710b47dacc2db37104b2 /linden/indra/newview/llappviewer.cpp | |
parent | feature: have clothing layer protection on and don't broadcast client name (diff) | |
download | meta-impy-ca719a0f68a7e7cefc4be173db0ced920e02f647.zip meta-impy-ca719a0f68a7e7cefc4be173db0ced920e02f647.tar.gz meta-impy-ca719a0f68a7e7cefc4be173db0ced920e02f647.tar.bz2 meta-impy-ca719a0f68a7e7cefc4be173db0ced920e02f647.tar.xz |
fix: Bug #269 clicking Quit Button crashes viewer.
Diffstat (limited to 'linden/indra/newview/llappviewer.cpp')
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 70 |
1 files changed, 37 insertions, 33 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 35e7a46..0b09d00 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -2744,30 +2744,8 @@ void LLAppViewer::requestLogout(bool quit_after) | |||
2744 | 2744 | ||
2745 | llinfos << "requestLogout" << llendl; | 2745 | llinfos << "requestLogout" << llendl; |
2746 | 2746 | ||
2747 | LLViewerRegion* region = gAgent.getRegion(); | 2747 | //NOTE: don't do cleanup here, or you get in trouble with notification callbacks |
2748 | 2748 | //put cleanup in idleShutdown() instead | |
2749 | if( (LLStartUp::getStartupState() >= STATE_STARTED) && region ) | ||
2750 | { | ||
2751 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); | ||
2752 | effectp->setPositionGlobal(gAgent.getPositionGlobal()); | ||
2753 | effectp->setColor(LLColor4U(gAgent.getEffectColor())); | ||
2754 | LLHUDManager::getInstance()->sendEffects(); | ||
2755 | effectp->markDead() ;//remove it. | ||
2756 | //send_stats(); if we're quitting the server shouldn't need viewer stats. | ||
2757 | } | ||
2758 | else | ||
2759 | { | ||
2760 | mQuitRequested=true; | ||
2761 | LLAppViewer::instance()->forceQuit(); | ||
2762 | } | ||
2763 | |||
2764 | // Attempt to close all floaters that might be | ||
2765 | // editing things. | ||
2766 | if (gFloaterView) | ||
2767 | { | ||
2768 | // application is quitting | ||
2769 | gFloaterView->closeAllChildren(true); | ||
2770 | } | ||
2771 | 2749 | ||
2772 | gLogoutTimer.reset(); | 2750 | gLogoutTimer.reset(); |
2773 | } | 2751 | } |
@@ -2782,11 +2760,10 @@ static bool finish_quit(const LLSD& notification, const LLSD& response) | |||
2782 | } | 2760 | } |
2783 | return false; | 2761 | return false; |
2784 | } | 2762 | } |
2785 | static LLNotificationFunctorRegistration finish_quit_reg("ConfirmQuit", finish_quit); | ||
2786 | 2763 | ||
2787 | void LLAppViewer::userQuit() | 2764 | void LLAppViewer::userQuit() |
2788 | { | 2765 | { |
2789 | LLNotifications::instance().add("ConfirmQuit"); | 2766 | LLNotifications::instance().add("ConfirmQuit", LLSD(), LLSD(), finish_quit); |
2790 | } | 2767 | } |
2791 | 2768 | ||
2792 | //static | 2769 | //static |
@@ -3329,6 +3306,14 @@ void LLAppViewer::idle() | |||
3329 | LLAppViewer::instance()->forceQuit(); | 3306 | LLAppViewer::instance()->forceQuit(); |
3330 | } | 3307 | } |
3331 | } | 3308 | } |
3309 | // Handle shutdown process, for example, | ||
3310 | // wait for floaters to close, send quit message, | ||
3311 | // forcibly quit if it has taken too long | ||
3312 | if (mQuitRequested || mLogoutRequested) | ||
3313 | { | ||
3314 | idleShutdown(); | ||
3315 | } | ||
3316 | |||
3332 | 3317 | ||
3333 | // Must wait until both have avatar object and mute list, so poll | 3318 | // Must wait until both have avatar object and mute list, so poll |
3334 | // here. | 3319 | // here. |
@@ -3665,13 +3650,7 @@ void LLAppViewer::idle() | |||
3665 | } | 3650 | } |
3666 | } | 3651 | } |
3667 | 3652 | ||
3668 | // Handle shutdown process, for example, | 3653 | |
3669 | // wait for floaters to close, send quit message, | ||
3670 | // forcibly quit if it has taken too long | ||
3671 | if (mQuitRequested || mLogoutRequested) | ||
3672 | { | ||
3673 | idleShutdown(); | ||
3674 | } | ||
3675 | 3654 | ||
3676 | stop_glerror(); | 3655 | stop_glerror(); |
3677 | } | 3656 | } |
@@ -3683,6 +3662,31 @@ void LLAppViewer::idleShutdown() | |||
3683 | { | 3662 | { |
3684 | return; | 3663 | return; |
3685 | } | 3664 | } |
3665 | LLViewerRegion* region = gAgent.getRegion(); | ||
3666 | |||
3667 | if( (LLStartUp::getStartupState() >= STATE_STARTED) && region ) | ||
3668 | { | ||
3669 | LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); | ||
3670 | effectp->setPositionGlobal(gAgent.getPositionGlobal()); | ||
3671 | effectp->setColor(LLColor4U(gAgent.getEffectColor())); | ||
3672 | LLHUDManager::getInstance()->sendEffects(); | ||
3673 | effectp->markDead() ;//remove it. | ||
3674 | //send_stats(); if we're quitting the server shouldn't need viewer stats. | ||
3675 | } | ||
3676 | else | ||
3677 | { | ||
3678 | mQuitRequested=true; | ||
3679 | //awfixme | ||
3680 | forceQuit(); | ||
3681 | } | ||
3682 | |||
3683 | // Attempt to close all floaters that might be | ||
3684 | // editing things. | ||
3685 | if (gFloaterView) | ||
3686 | { | ||
3687 | // application is quitting | ||
3688 | gFloaterView->closeAllChildren(true); | ||
3689 | } | ||
3686 | 3690 | ||
3687 | // close IM interface | 3691 | // close IM interface |
3688 | if(gIMMgr) | 3692 | if(gIMMgr) |