From 975975029d7f248cdf917da670ffd6c6b98d40c1 Mon Sep 17 00:00:00 2001 From: Logan Dethrow Date: Tue, 5 Jul 2011 16:55:43 -0400 Subject: STORM-1112 Fixed crash on quit. Other minor fixes: * Reordered HTTP proxy choices in settings dialog * Now using setBlocking and setNonBlocking LLSocket methods during TCP handshakes. * Made those LLSocket methods available outside the class. --- indra/newview/llappviewer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d2582d524d..57e197a263 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -136,6 +136,7 @@ #include "lltoolmgr.h" #include "llassetstorage.h" #include "llpolymesh.h" +#include "llproxy.h" #include "llaudioengine.h" #include "llstreamingaudio.h" #include "llviewermenu.h" @@ -1869,6 +1870,8 @@ bool LLAppViewer::cleanup() LLWeb::loadURLExternal( gLaunchFileOnQuit, false ); llinfos << "File launched." << llendflush; } + llinfos << "Cleaning up LLProxy." << llendl; + LLProxy::cleanupClass(); LLMainLoopRepeater::instance().stop(); -- cgit v1.2.3 From 0f1dea30f827f920d2323d9450826f1a4baaa10b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 19 Aug 2011 13:48:44 +0300 Subject: STORM-1268 Settings for ignorable dialogs were reset during deferred auto-upgrade. Reason: In case of deferred upgrade (i.e. when you select "Later...") the defaults for notifications settings are not loaded, so when the viewer exits after launching the updater, it incorrectly re-saves notifications settings. Fix: Initialize settings earlier, so that viewer picks them up in update mode. --- indra/newview/llappviewer.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d12b971bde..7ad5e92f99 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -731,6 +731,23 @@ bool LLAppViewer::init() initThreads(); LL_INFOS("InitInfo") << "Threads initialized." << LL_ENDL ; + // Initialize settings early so that the defaults for ignorable dialogs are + // picked up and then correctly re-saved after launching the updater (STORM-1268). + LLUI::settings_map_t settings_map; + settings_map["config"] = &gSavedSettings; + settings_map["ignores"] = &gWarningSettings; + settings_map["floater"] = &gSavedSettings; // *TODO: New settings file + settings_map["account"] = &gSavedPerAccountSettings; + + LLUI::initClass(settings_map, + LLUIImageList::getInstance(), + ui_audio_callback, + &LLUI::sGLScaleFactor); + LL_INFOS("InitInfo") << "UI initialized." << LL_ENDL ; + + LLNotifications::instance(); + LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ; + writeSystemInfo(); // Initialize updater service (now that we have an io pump) @@ -772,19 +789,8 @@ bool LLAppViewer::init() { LLError::setPrintLocation(true); } - - // Widget construction depends on LLUI being initialized - LLUI::settings_map_t settings_map; - settings_map["config"] = &gSavedSettings; - settings_map["ignores"] = &gWarningSettings; - settings_map["floater"] = &gSavedSettings; // *TODO: New settings file - settings_map["account"] = &gSavedPerAccountSettings; - LLUI::initClass(settings_map, - LLUIImageList::getInstance(), - ui_audio_callback, - &LLUI::sGLScaleFactor); - + // Setup paths and LLTrans after LLUI::initClass has been called LLUI::setupPaths(); LLTransUtil::parseStrings("strings.xml", default_trans_args); -- cgit v1.2.3 From 1ed945b5a08a40399ff63ed657c66416c3baf7cf Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 19 Aug 2011 19:58:00 +0300 Subject: STORM-1543 WIP Fixed auto-moving offered inventory items to trash. It turned out impossible to properly remove an inventory item from within LLDiscardAgentOffer::done(), because that would lead to nested LLInventoryModel::notifyObservers() calls. Fixed that by deferring removal until the next LLAppViewer::idle() iteration. Also elimiteed duplicated code. --- indra/newview/llappviewer.cpp | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d12b971bde..16c2b2d55a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -321,6 +321,47 @@ static std::string gLaunchFileOnQuit; // Used on Win32 for other apps to identify our window (eg, win_setup) const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; +//-- LLDeferredTaskList ------------------------------------------------------ + +/** + * A list of deferred tasks. + * + * We sometimes need to defer execution of some code until the viewer gets idle, + * e.g. removing an inventory item from within notifyObservers() may not work out. + * + * Tasks added to this list will be executed in the next LLAppViewer::idle() iteration. + * All tasks are executed only once. + */ +class LLDeferredTaskList: + public LLSingleton, + private LLDestroyClass +{ + LOG_CLASS(LLDeferredTaskList); + friend class LLAppViewer; + friend class LLDestroyClass; + typedef boost::signals2::signal signal_t; + + void addTask(const signal_t::slot_type& cb) + { + mSignal.connect(cb); + } + + void run() + { + if (mSignal.empty()) return; + + mSignal(); + mSignal.disconnect_all_slots(); + } + + static void destroyClass() + { + instance().mSignal.disconnect_all_slots(); + } + + signal_t mSignal; +}; + //---------------------------------------------------------------------------- // List of entries from strings.xml to always replace @@ -3820,6 +3861,11 @@ bool LLAppViewer::initCache() } } +void LLAppViewer::addOnIdleCallback(const boost::function& cb) +{ + LLDeferredTaskList::instance().addTask(cb); +} + void LLAppViewer::purgeCache() { LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << LL_ENDL; @@ -4413,6 +4459,8 @@ void LLAppViewer::idle() gAudiop->idle(max_audio_decode_time); } } + + LLDeferredTaskList::instance().run(); // Handle shutdown process, for example, // wait for floaters to close, send quit message, -- cgit v1.2.3 From 5578c285d866488d06f99f5e72e3fb9291d37eca Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 22 Aug 2011 14:01:18 +0300 Subject: STORM-1543 WIP More cleanup and comments. --- indra/newview/llappviewer.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 16c2b2d55a..326b5fd629 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -332,13 +332,11 @@ const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; * Tasks added to this list will be executed in the next LLAppViewer::idle() iteration. * All tasks are executed only once. */ -class LLDeferredTaskList: - public LLSingleton, - private LLDestroyClass +class LLDeferredTaskList: public LLSingleton { LOG_CLASS(LLDeferredTaskList); + friend class LLAppViewer; - friend class LLDestroyClass; typedef boost::signals2::signal signal_t; void addTask(const signal_t::slot_type& cb) @@ -348,15 +346,11 @@ class LLDeferredTaskList: void run() { - if (mSignal.empty()) return; - - mSignal(); - mSignal.disconnect_all_slots(); - } - - static void destroyClass() - { - instance().mSignal.disconnect_all_slots(); + if (!mSignal.empty()) + { + mSignal(); + mSignal.disconnect_all_slots(); + } } signal_t mSignal; @@ -4460,6 +4454,7 @@ void LLAppViewer::idle() } } + // Execute deferred tasks. LLDeferredTaskList::instance().run(); // Handle shutdown process, for example, -- cgit v1.2.3