From 487a487ce2eda4f2ec328802af9c3aa6ec31bf12 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 13 Sep 2020 20:52:39 +0200 Subject: [PATCH] [FIXED] Assertion failure on LLApp::isQuitting() in RlvHandler::cleanup() when disconnecting -> Also prefer using isExiting() over isQuitting() --- indra/newview/llappviewer.cpp | 5 ++++- indra/newview/rlvcommon.cpp | 2 +- indra/newview/rlvhandler.cpp | 15 +++++++++------ indra/newview/rlvui.cpp | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9117d8da60..3d3404e494 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -378,7 +378,10 @@ const std::string START_MARKER_FILE_NAME("SecondLife.start_marker"); const std::string ERROR_MARKER_FILE_NAME("SecondLife.error_marker"); const std::string LLERROR_MARKER_FILE_NAME("SecondLife.llerror_marker"); const std::string LOGOUT_MARKER_FILE_NAME("SecondLife.logout_marker"); -static BOOL gDoDisconnect = FALSE; +//static BOOL gDoDisconnect = FALSE; +// [RLVa:KB] - Checked: RLVa-2.3 +BOOL gDoDisconnect = FALSE; +// [/RLVa:KB] static std::string gLaunchFileOnQuit; // Used on Win32 for other apps to identify our window (eg, win_setup) diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index e9f2d2fc69..0eee08d0a6 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -136,7 +136,7 @@ void RlvSettings::initClass() // Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d void RlvSettings::updateLoginLastLocation() { - if ( (!LLApp::isQuitting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) ) + if ( (!LLApp::isExiting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) ) { BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!RlvActions::canStand()); if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue) diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index 7f750be450..6c7e549767 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -70,6 +70,9 @@ // Boost includes #include +// llappviewer.cpp +extern BOOL gDoDisconnect; + // ============================================================================ // Static variable initialization // @@ -158,7 +161,7 @@ void RlvHandler::cleanup() // // Clean up any restrictions that are still active // - RLV_ASSERT(LLApp::isQuitting()); // Several commands toggle debug settings but won't if they know the viewer is quitting + RLV_ASSERT(LLApp::isExiting() || gDoDisconnect); // Several commands toggle debug settings but won't if they know the viewer is quitting // Assume we have no way to predict how m_Objects will change so make a copy ahead of time uuid_vec_t idRlvObjects; @@ -2385,7 +2388,7 @@ ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvComma template<> template<> void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) { - if (LLApp::isQuitting()) + if (LLApp::isExiting()) return; // Nothing to do if the viewer is shutting down // @@ -2440,7 +2443,7 @@ void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour template<> template<> void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) { - if (LLApp::isQuitting()) + if (LLApp::isExiting()) return; // Nothing to do if the viewer is shutting down // Update the shownames context @@ -2477,7 +2480,7 @@ template<> template<> ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvCommand& rlvCmd, bool& fRefCount) { ERlvCmdRet eRet = RlvBehaviourGenericHandler::onCommand(rlvCmd, fRefCount); - if ( (RLV_RET_SUCCESS == eRet) && (rlvCmd.hasOption()) && (!LLApp::isQuitting()) ) + if ( (RLV_RET_SUCCESS == eRet) && (rlvCmd.hasOption()) && (!LLApp::isExiting()) ) { const LLUUID idAgent = RlvCommandOptionHelper::parseOption(rlvCmd.getOption()); @@ -2502,7 +2505,7 @@ ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvCommand& template<> template<> void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) { - if (LLApp::isQuitting()) + if (LLApp::isExiting()) return; // Nothing to do if the viewer is shutting down // Update the shownames context @@ -2526,7 +2529,7 @@ ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvComman template<> template<> void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) { - if (LLApp::isQuitting()) + if (LLApp::isExiting()) return; // Nothing to do if the viewer is shutting down // Refresh the nearby people list diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index cd6e5831ce..846460096d 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -77,7 +77,7 @@ RlvUIEnabler::RlvUIEnabler() // Checked: 2010-02-28 (RLVa-1.4.0a) | Added: RLVa-1.2.0a void RlvUIEnabler::onBehaviourToggle(ERlvBehaviour eBhvr, ERlvParamType eType) { - bool fQuitting = LLApp::isQuitting(); + bool fQuitting = LLApp::isExiting(); for (behaviour_handler_map_t::const_iterator itHandler = m_Handlers.lower_bound(eBhvr), endHandler = m_Handlers.upper_bound(eBhvr); itHandler != endHandler; ++itHandler) {