diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 284bfb2afa..4f4b071429 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -104,7 +104,6 @@ BOOL LLApp::sLogInSignal = FALSE; // Keeps track of application status LLScalarCond LLApp::sStatus{LLApp::APP_STATUS_STOPPED}; LLAppErrorHandler LLApp::sErrorHandler = NULL; -BOOL LLApp::sErrorThreadRunning = FALSE; LLApp::LLApp() @@ -793,13 +792,8 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) return; } - // Flag status to ERROR, so thread_error does its work. + // Flag status to ERROR LLApp::setError(); - // Block in the signal handler until somebody says that we're done. - while (LLApp::sErrorThreadRunning && !LLApp::isStopped()) - { - ms_sleep(10); - } if (LLApp::sLogInSignal) { diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index c832c8b142..a892bfeb1e 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -291,7 +291,6 @@ protected: static void setStatus(EAppStatus status); // Use this to change the application status. static LLScalarCond sStatus; // Reflects current application status - static BOOL sErrorThreadRunning; // Set while the error thread is running static BOOL sDisableCrashlogger; // Let the OS handle crashes for us. std::wstring mCrashReportPipeStr; //Name of pipe to use for crash reporting. diff --git a/indra/llcommon/threadpool.cpp b/indra/llcommon/threadpool.cpp index d5adf11264..22bbff4478 100644 --- a/indra/llcommon/threadpool.cpp +++ b/indra/llcommon/threadpool.cpp @@ -21,11 +21,12 @@ #include "llevents.h" #include "stringize.h" -LL::ThreadPool::ThreadPool(const std::string& name, size_t threads, size_t capacity): +LL::ThreadPool::ThreadPool(const std::string& name, size_t threads, size_t capacity, bool auto_shutdown): super(name), mQueue(name, capacity), mName("ThreadPool:" + name), - mThreadCount(threads) + mThreadCount(threads), + mAutomaticShutdown(auto_shutdown) {} void LL::ThreadPool::start() @@ -39,6 +40,13 @@ void LL::ThreadPool::start() run(tname); }); } + + // Some threads might need to run longer than LLEventPumps + if (!mAutomaticShutdown) + { + return; + } + // Listen on "LLApp", and when the app is shutting down, close the queue // and join the workers. LLEventPumps::instance().obtain("LLApp").listen( diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h index f8eec3b457..22c875edb9 100644 --- a/indra/llcommon/threadpool.h +++ b/indra/llcommon/threadpool.h @@ -31,7 +31,7 @@ namespace LL * Pass ThreadPool a string name. This can be used to look up the * relevant WorkQueue. */ - ThreadPool(const std::string& name, size_t threads=1, size_t capacity=1024); + ThreadPool(const std::string& name, size_t threads=1, size_t capacity=1024, bool auto_shutdown = true); virtual ~ThreadPool(); /** @@ -66,6 +66,7 @@ namespace LL std::string mName; size_t mThreadCount; std::vector> mThreads; + bool mAutomaticShutdown; }; } // namespace LL diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 8f72e84b28..0b6ce3234a 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -832,6 +832,7 @@ void LLWindowWin32::close() // Is window is already closed? if (!mWindowHandle) { + mWindowThread->close(); return; } @@ -4717,7 +4718,7 @@ void LLWindowWin32::getWindowChrome( U32 &aChromeW, U32 &aChromeH ) #endif // LL_WINDOWS inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread() - : ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE) + : ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE, false) { ThreadPool::start(); } diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 2031fc6a4e..2f3d75d123 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -619,6 +619,8 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, static LLCachedControl FSllOwnerSayToScriptDebugWindow(gSavedPerAccountSettings, "FSllOwnerSayToScriptDebugWindow"); if (chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG || (chat_msg.mChatType == CHAT_TYPE_OWNER && FSllOwnerSayToScriptDebugWindow)) { + if (LLFloater::isQuitRequested()) return; + // [FSllOwnerSayToScriptDebugWindow] Show llOwnerSays in the script debug window instead of local chat // if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE && chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG) diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index 16cdbeab9a..ab976b5276 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -594,9 +594,7 @@ void LLPanelProfilePick::setAvatarId(const LLUUID& avatar_id) mPickName->setEnabled(TRUE); mPickDescription->setEnabled(TRUE); // Make sure the "Set Location" button is only visible when viewing own picks - // mSetCurrentLocationButton->setVisible(TRUE); childSetVisible("set_to_curr_location_btn_lp", true); - // } else { @@ -613,7 +611,7 @@ BOOL LLPanelProfilePick::postBuild() mSaveButton = getChild("save_changes_btn"); mCreateButton = getChild("create_changes_btn"); mCancelButton = getChild("cancel_changes_btn"); - mSetCurrentLocationButton = getChild("set_to_curr_location_btn"); + mSetCurrentLocationButton = getChild("set_to_curr_location_btn"); // Keep set location button mSnapshotCtrl = getChild("pick_snapshot"); mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelProfilePick::onSnapshotChanged, this)); @@ -624,7 +622,7 @@ BOOL LLPanelProfilePick::postBuild() mSaveButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSave, this)); mCreateButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSave, this)); mCancelButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickCancel, this)); - mSetCurrentLocationButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSetLocation, this)); + mSetCurrentLocationButton->setCommitCallback(boost::bind(&LLPanelProfilePick::onClickSetLocation, this)); // Keep set location button mPickName->setKeystrokeCallback(boost::bind(&LLPanelProfilePick::onPickChanged, this, _1), NULL); mPickName->setEnabled(FALSE); @@ -786,6 +784,7 @@ BOOL LLPanelProfilePick::isDirty() const return FALSE; } +// Keep set location button void LLPanelProfilePick::onClickSetLocation() { // Save location for later use. @@ -811,6 +810,7 @@ void LLPanelProfilePick::onClickSetLocation() mLocationChanged = true; enableSaveButton(TRUE); } +// void LLPanelProfilePick::onClickSave() { diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index 34407d37d5..9bf6431a8b 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -208,10 +208,12 @@ protected: */ void resetDirty() override; + // Keep set location button /** * Callback for "Set Location" button click */ void onClickSetLocation(); + // /** * Callback for "Save" and "Create" button click @@ -235,7 +237,7 @@ protected: LLTextureCtrl* mSnapshotCtrl; LLLineEditor* mPickName; LLTextEditor* mPickDescription; - LLButton* mSetCurrentLocationButton; + LLButton* mSetCurrentLocationButton; // Keep set location button LLButton* mSaveButton; LLButton* mCreateButton; LLButton* mCancelButton;