diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2024-12-12 23:32:34 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-02-28 00:02:02 +0200 |
commit | 4214ab8e79809412fdec626fa5f914723e6d4704 (patch) | |
tree | 0d1f34048e786a34ab61d9fe3bec4db42859de86 | |
parent | d81f3dcfc276263a0bc3aea5efe01d383b82229d (diff) |
#3280 Fix crashes at gFloaterTools
Likely specific to headless client
-rw-r--r-- | indra/newview/llagent.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llgiveinventory.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llpanelprimmediacontrols.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 5 | ||||
-rw-r--r-- | indra/newview/lltoolbrush.cpp | 5 | ||||
-rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 23 | ||||
-rw-r--r-- | indra/newview/lltoolplacer.cpp | 5 | ||||
-rw-r--r-- | indra/newview/lltoolselectland.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewerobject.cpp | 12 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 2 |
11 files changed, 58 insertions, 24 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8756baa04a..a076594e0a 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2501,7 +2501,10 @@ void LLAgent::endAnimationUpdateUI() gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode()); } - gFloaterTools->dirty(); + if (gFloaterTools) + { + gFloaterTools->dirty(); + } // Don't let this be called more than once if the camera // mode hasn't changed. --JC diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 1259b65ebe..57dd203f2f 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -414,7 +414,11 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, effectp->setTargetObject(gObjectList.findObject(to_agent)); effectp->setDuration(LL_HUD_DUR_SHORT); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gFloaterTools->dirty(); + + if (gFloaterTools) + { + gFloaterTools->dirty(); + } LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); @@ -572,7 +576,11 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, effectp->setTargetObject(gObjectList.findObject(to_agent)); effectp->setDuration(LL_HUD_DUR_SHORT); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gFloaterTools->dirty(); + + if (gFloaterTools) + { + gFloaterTools->dirty(); + } LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY); diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index b8c12ce0b9..b00b9d1ad1 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -294,7 +294,7 @@ void LLPanelPrimMediaControls::updateShape() LLViewerMediaImpl* media_impl = getTargetMediaImpl(); LLViewerObject* objectp = getTargetObject(); - if(!media_impl || gFloaterTools->getVisible()) + if(!media_impl || (gFloaterTools && gFloaterTools->getVisible())) { setVisible(false); return; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index fceb25b3d3..1d4bfb0ed9 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -7253,7 +7253,10 @@ void dialog_refresh_all() // *TODO: Eliminate all calls into outside classes below, make those // objects register with the update signal. - gFloaterTools->dirty(); + if (gFloaterTools) + { + gFloaterTools->dirty(); + } gMenuObject->needsArrange(); diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index 2fe81df4fb..cf7b123fa7 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -447,7 +447,10 @@ void LLToolBrushLand::handleSelect() { gEditMenuHandler = this; - gFloaterTools->setStatusText("modifyland"); + if (gFloaterTools) + { + gFloaterTools->setStatusText("modifyland"); + } // if (!mBrushSelected) { mBrushSelected = true; diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 4efa289141..75adb722f3 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1253,6 +1253,7 @@ void LLToolDragAndDrop::dropMaterial(LLViewerObject* hit_obj, // If user dropped a material onto face it implies // applying texture now without cancel, save to selection if (nodep + && gFloaterTools && gFloaterTools->getVisible() && nodep->mSavedGLTFMaterialIds.size() > hit_face) { @@ -1429,10 +1430,10 @@ void LLToolDragAndDrop::dropTexture(LLViewerObject* hit_obj, // If user dropped a texture onto face it implies // applying texture now without cancel, save to selection - LLPanelFace* panel_face = gFloaterTools->getPanelFace(); + LLPanelFace* panel_face = gFloaterTools ? gFloaterTools->getPanelFace() : nullptr; if (nodep - && gFloaterTools->getVisible() && panel_face + && gFloaterTools->getVisible() && panel_face->getTextureDropChannel() == 0 /*texture*/ && nodep->mSavedTextures.size() > hit_face) { @@ -1488,8 +1489,8 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, if (allow_adding_to_override) { LLGLTFMaterial::TextureInfo drop_channel = LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR; - LLPanelFace* panel_face = gFloaterTools->getPanelFace(); - if (gFloaterTools->getVisible() && panel_face) + LLPanelFace* panel_face = gFloaterTools ? gFloaterTools->getPanelFace() : nullptr; + if (panel_face && gFloaterTools->getVisible()) { drop_channel = panel_face->getPBRDropChannel(); } @@ -1514,9 +1515,9 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, LLTextureEntry* tep = hit_obj->getTE(hit_face); - LLPanelFace* panel_face = gFloaterTools->getPanelFace(); + LLPanelFace* panel_face = gFloaterTools ? gFloaterTools->getPanelFace() : nullptr; - if (gFloaterTools->getVisible() && panel_face) + if (panel_face && gFloaterTools->getVisible()) { tex_channel = (tex_channel > -1) ? tex_channel : panel_face->getTextureDropChannel(); switch (tex_channel) @@ -1611,7 +1612,10 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj, } } hit_obj->saveScript(new_script, active, true); - gFloaterTools->dirty(); + if (gFloaterTools) + { + gFloaterTools->dirty(); + } // VEFFECT: SetScript LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, true); @@ -1844,7 +1848,10 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, effectp->setTargetObject(hit_obj); effectp->setDuration(LL_HUD_DUR_SHORT); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gFloaterTools->dirty(); + if (gFloaterTools) + { + gFloaterTools->dirty(); + } } // accessor that looks at permissions, copyability, and names of diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index b15bb5efd5..0d141d7545 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -527,7 +527,10 @@ bool LLToolPlacer::handleHover(S32 x, S32 y, MASK mask) void LLToolPlacer::handleSelect() { - gFloaterTools->setStatusText("place"); + if (gFloaterTools) + { + gFloaterTools->setStatusText("place"); + } } void LLToolPlacer::handleDeselect() diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp index 88553c7557..331581fd88 100644 --- a/indra/newview/lltoolselectland.cpp +++ b/indra/newview/lltoolselectland.cpp @@ -207,7 +207,10 @@ void LLToolSelectLand::render() void LLToolSelectLand::handleSelect() { - gFloaterTools->setStatusText("selectland"); + if (gFloaterTools) + { + gFloaterTools->setStatusText("selectland"); + } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6281ac1f9e..1c9a892a4f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3177,7 +3177,11 @@ void handle_object_edit() LLFloaterReg::showInstance("build"); LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); - gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() ); + + if (gFloaterTools) + { + gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() ); + } LLViewerJoystick::getInstance()->moveObjects(true); LLViewerJoystick::getInstance()->setNeedsReset(true); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 86440fca48..74d795ea25 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -1290,7 +1290,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, #endif //clear cost and linkset cost setObjectCostStale(); - if (isSelected()) + if (isSelected() && gFloaterTools) { gFloaterTools->dirty(); } @@ -1729,7 +1729,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, #endif setObjectCostStale(); - if (isSelected()) + if (isSelected() && gFloaterTools) { gFloaterTools->dirty(); } @@ -3747,7 +3747,7 @@ void LLViewerObject::setObjectCost(F32 cost) mObjectCost = cost; mCostStale = false; - if (isSelected()) + if (isSelected() && gFloaterTools) { gFloaterTools->dirty(); } @@ -3767,7 +3767,7 @@ void LLViewerObject::setLinksetCost(F32 cost) iter++; } - if (needs_refresh) + if (needs_refresh && gFloaterTools) { gFloaterTools->dirty(); } @@ -3778,7 +3778,7 @@ void LLViewerObject::setPhysicsCost(F32 cost) mPhysicsCost = cost; mCostStale = false; - if (isSelected()) + if (isSelected() && gFloaterTools) { gFloaterTools->dirty(); } @@ -3789,7 +3789,7 @@ void LLViewerObject::setLinksetPhysicsCost(F32 cost) mLinksetPhysicsCost = cost; mCostStale = false; - if (isSelected()) + if (isSelected() && gFloaterTools) { gFloaterTools->dirty(); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5f096a5356..6c5fd855fd 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7208,7 +7208,7 @@ void LLPipeline::tonemap(LLRenderTarget* src, LLRenderTarget* dst) LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); - bool no_post = gSnapshotNoPost || psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f || (buildNoPost && gFloaterTools->isAvailable()); + bool no_post = gSnapshotNoPost || psky->getReflectionProbeAmbiance(should_auto_adjust) == 0.f || (buildNoPost && gFloaterTools && gFloaterTools->isAvailable()); LLGLSLShader& shader = no_post ? gNoPostTonemapProgram : gDeferredPostTonemapProgram; shader.bind(); |