#3280 Fix crashes at gFloaterTools

Likely specific to headless client
master
Andrey Kleshchev 2024-12-12 23:32:34 +02:00 committed by Andrey Kleshchev
parent d81f3dcfc2
commit 4214ab8e79
11 changed files with 58 additions and 24 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -447,7 +447,10 @@ void LLToolBrushLand::handleSelect()
{
gEditMenuHandler = this;
gFloaterTools->setStatusText("modifyland");
if (gFloaterTools)
{
gFloaterTools->setStatusText("modifyland");
}
// if (!mBrushSelected)
{
mBrushSelected = true;

View File

@ -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

View File

@ -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()

View File

@ -207,7 +207,10 @@ void LLToolSelectLand::render()
void LLToolSelectLand::handleSelect()
{
gFloaterTools->setStatusText("selectland");
if (gFloaterTools)
{
gFloaterTools->setStatusText("selectland");
}
}

View File

@ -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);

View File

@ -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();
}

View File

@ -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();