diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llappviewer.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llpanelpermissions.cpp | 39 | ||||
-rw-r--r-- | indra/newview/lltexturecache.cpp | 70 | ||||
-rw-r--r-- | indra/newview/lltexturecache.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 28 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_viewer.xml | 17 |
7 files changed, 144 insertions, 34 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index acec68f393..687b76c224 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1581,6 +1581,11 @@ bool LLAppViewer::doFrame() saveFinalSnapshot(); } + if (LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->terminate(); + } + delete gServicePump; destroyMainloopTimeout(); @@ -1680,11 +1685,6 @@ bool LLAppViewer::cleanup() // Give any remaining SLPlugin instances a chance to exit cleanly. LLPluginProcessParent::shutdown(); - if (LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->terminate(); - } - disconnectViewer(); LL_INFOS() << "Viewer disconnected" << LL_ENDL; diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index fc44ce340c..ef16427713 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -1210,23 +1210,34 @@ void LLPanelPermissions::setAllSaleInfo() LLSaleInfo new_sale_info(sale_type, price); LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(new_sale_info); - struct f : public LLSelectedObjectFunctor + // Note: won't work right if a root and non-root are both single-selected (here and other places). + BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() + && LLSelectMgr::getInstance()->selectGetRootsModify()) + || LLSelectMgr::getInstance()->selectGetModify(); + BOOL is_nonpermanent_enforced = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() + && LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced()) + || LLSelectMgr::getInstance()->selectGetNonPermanentEnforced(); + + if (is_perm_modify && is_nonpermanent_enforced) { - virtual bool apply(LLViewerObject* object) + struct f : public LLSelectedObjectFunctor { - return object->getClickAction() == CLICK_ACTION_BUY - || object->getClickAction() == CLICK_ACTION_TOUCH; + virtual bool apply(LLViewerObject* object) + { + return object->getClickAction() == CLICK_ACTION_BUY + || object->getClickAction() == CLICK_ACTION_TOUCH; + } + } check_actions; + + // Selection should only contain objects that are of target + // action already or of action we are aiming to remove. + bool default_actions = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&check_actions); + + if (default_actions && old_sale_info.isForSale() != new_sale_info.isForSale()) + { + U8 new_click_action = new_sale_info.isForSale() ? CLICK_ACTION_BUY : CLICK_ACTION_TOUCH; + LLSelectMgr::getInstance()->selectionSetClickAction(new_click_action); } - } check_actions; - - // Selection should only contain objects that are of target - // action already or of action we are aiming to remove. - bool default_actions = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&check_actions); - - if (default_actions && old_sale_info.isForSale() != new_sale_info.isForSale()) - { - U8 new_click_action = new_sale_info.isForSale() ? CLICK_ACTION_BUY : CLICK_ACTION_TOUCH; - LLSelectMgr::getInstance()->selectionSetClickAction(new_click_action); } } diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index dd5dce3279..633e025478 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -615,7 +615,7 @@ bool LLTextureCacheRemoteWorker::doWrite() if(idx >= 0) { // write to the fast cache. - if(!mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)) + if(!mCache->writeToFastCache(mID, idx, mRawImage, mRawDiscardLevel)) { LL_WARNS() << "writeToFastCache failed" << LL_ENDL; mDataSize = -1; // failed @@ -1998,8 +1998,48 @@ LLPointer<LLImageRaw> LLTextureCache::readFromFastCache(const LLUUID& id, S32& d return raw; } +#if LL_WINDOWS + +static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific + +U32 exception_dupe_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop) +{ + if (code == STATUS_MSC_EXCEPTION) + { + // C++ exception, go on + return EXCEPTION_CONTINUE_SEARCH; + } + else + { + // handle it + return EXCEPTION_EXECUTE_HANDLER; + } +} + +//due to unwinding +void dupe(LLPointer<LLImageRaw> &raw) +{ + raw = raw->duplicate(); +} + +void logExceptionDupplicate(LLPointer<LLImageRaw> &raw) +{ + __try + { + dupe(raw); + } + __except (exception_dupe_filter(GetExceptionCode(), GetExceptionInformation())) + { + // convert to C++ styled exception + char integer_string[32]; + sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode()); + throw std::exception(integer_string); + } +} +#endif + //return the fast cache location -bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 discardlevel) +bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointer<LLImageRaw> raw, S32 discardlevel) { //rescale image if needed if (raw.isNull() || raw->isBufferInvalid() || !raw->getData()) @@ -2027,7 +2067,31 @@ bool LLTextureCache::writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 dis if(w * h *c > 0) //valid { //make a duplicate to keep the original raw image untouched. - raw = raw->duplicate(); + + try + { +#if LL_WINDOWS + // Temporary diagnostics for scale/duplicate crash + logExceptionDupplicate(raw); +#else + raw = raw->duplicate(); +#endif + } + catch (...) + { + removeFromCache(image_id); + LL_ERRS() << "Failed to cache image: " << image_id + << " local id: " << id + << " Exception: " << boost::current_exception_diagnostic_information() + << " Image new width: " << w + << " Image new height: " << h + << " Image new components: " << c + << " Image discard difference: " << i + << LL_ENDL; + + return false; + } + if (raw->isBufferInvalid()) { LL_WARNS() << "Invalid image duplicate buffer" << LL_ENDL; diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 95f9afc2bc..987b9375c0 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -179,7 +179,7 @@ private: void openFastCache(bool first_time = false); void closeFastCache(bool forced = false); - bool writeToFastCache(S32 id, LLPointer<LLImageRaw> raw, S32 discardlevel); + bool writeToFastCache(LLUUID image_id, S32 cache_id, LLPointer<LLImageRaw> raw, S32 discardlevel); private: // Internal diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 0eebf2051c..f7250ffb66 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3649,9 +3649,16 @@ class LLSelfSitDown : public view_listener_t } }; + + +bool show_sitdown_self() +{ + return isAgentAvatarValid() && !gAgentAvatarp->isSitting(); +} + bool enable_sitdown_self() { - return isAgentAvatarValid() && !gAgentAvatarp->isSitting() && !gAgentAvatarp->isEditingAppearance() && !gAgent.getFlying(); + return show_sitdown_self() && !gAgentAvatarp->isEditingAppearance() && !gAgent.getFlying(); } class LLCheckPanelPeopleTab : public view_listener_t @@ -9068,7 +9075,8 @@ void initialize_menus() view_listener_t::addMenu(new LLSelfStandUp(), "Self.StandUp"); enable.add("Self.EnableStandUp", boost::bind(&enable_standup_self)); view_listener_t::addMenu(new LLSelfSitDown(), "Self.SitDown"); - enable.add("Self.EnableSitDown", boost::bind(&enable_sitdown_self)); + enable.add("Self.EnableSitDown", boost::bind(&enable_sitdown_self)); + enable.add("Self.ShowSitDown", boost::bind(&show_sitdown_self)); view_listener_t::addMenu(new LLSelfRemoveAllAttachments(), "Self.RemoveAllAttachments"); view_listener_t::addMenu(new LLSelfEnableRemoveAllAttachments(), "Self.EnableRemoveAllAttachments"); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 6a3242b43f..1676f70b1e 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -542,6 +542,10 @@ void LLVivoxVoiceClient::connectorShutdown() writeString(stream.str()); } + else + { + mShutdownComplete = true; + } } void LLVivoxVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &agentID) @@ -1046,16 +1050,25 @@ bool LLVivoxVoiceClient::breakVoiceConnection(bool corowait) retval = result.has("connector"); } else - { // If we are not doing a corowait then we must sleep until the connector has responded + { + mRelogRequested = false; //stop the control coro + // If we are not doing a corowait then we must sleep until the connector has responded // otherwise we may very well close the socket too early. #if LL_WINDOWS - int count = 0; - while (!mShutdownComplete && 10 > count++) - { // Rider: This comes out to a max wait time of 10 seconds. - // The situation that brings us here is a call from ::terminate() - // and so the viewer is attempting to go away. Don't slow it down - // longer than this. + if (!mShutdownComplete) + { + // The situation that brings us here is a call from ::terminate() + // At this point message system is already down so we can't wait for + // the message, yet we need to receive "connector shutdown response". + // Either wait a bit and emulate it or check gMessageSystem for specific message _sleep(1000); + if (mConnected) + { + mConnected = false; + LLSD vivoxevent(LLSDMap("connector", LLSD::Boolean(false))); + LLEventPumps::instance().post("vivoxClientPump", vivoxevent); + } + mShutdownComplete = true; } #endif } @@ -3243,6 +3256,7 @@ void LLVivoxVoiceClient::connectorShutdownResponse(int statusCode, std::string & } mConnected = false; + mShutdownComplete = true; LLSD vivoxevent(LLSDMap("connector", LLSD::Boolean(false))); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index d28f47c2e1..7c6b1bc357 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -92,11 +92,24 @@ shortcut="alt|shift|S" name="Sit Down Here"> <menu_item_call.on_click - function="Self.SitDown" - parameter="" /> + function="Self.SitDown"/> + <menu_item_call.on_visible + function="Self.ShowSitDown"/> <menu_item_call.on_enable function="Self.EnableSitDown" /> </menu_item_call> + <menu_item_call + label="Stand Up" + layout="topleft" + shortcut="alt|shift|S" + name="Stand up"> + <menu_item_call.on_click + function="Self.StandUp"/> + <menu_item_call.on_visible + function="Self.EnableStandUp"/> + <menu_item_call.on_enable + function="Self.EnableStandUp" /> + </menu_item_call> <menu_item_check label="Fly" name="Fly" |