Skip to content

Commit 06d9ff1

Browse files
committed
#3280 Fix crashes at gFloaterTools
Likely specific to headless client
1 parent 8b77f76 commit 06d9ff1

11 files changed

+61
-27
lines changed

indra/newview/llagent.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2496,7 +2496,10 @@ void LLAgent::endAnimationUpdateUI()
24962496
gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode());
24972497
}
24982498

2499-
gFloaterTools->dirty();
2499+
if (gFloaterTools)
2500+
{
2501+
gFloaterTools->dirty();
2502+
}
25002503

25012504
// Don't let this be called more than once if the camera
25022505
// mode hasn't changed. --JC

indra/newview/llgiveinventory.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,11 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent,
414414
effectp->setTargetObject(gObjectList.findObject(to_agent));
415415
effectp->setDuration(LL_HUD_DUR_SHORT);
416416
effectp->setColor(LLColor4U(gAgent.getEffectColor()));
417-
gFloaterTools->dirty();
417+
418+
if (gFloaterTools)
419+
{
420+
gFloaterTools->dirty();
421+
}
418422

419423
LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY);
420424

@@ -572,7 +576,11 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent,
572576
effectp->setTargetObject(gObjectList.findObject(to_agent));
573577
effectp->setDuration(LL_HUD_DUR_SHORT);
574578
effectp->setColor(LLColor4U(gAgent.getEffectColor()));
575-
gFloaterTools->dirty();
579+
580+
if (gFloaterTools)
581+
{
582+
gFloaterTools->dirty();
583+
}
576584

577585
LLMuteList::getInstance()->autoRemove(to_agent, LLMuteList::AR_INVENTORY);
578586

indra/newview/llpanelprimmediacontrols.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void LLPanelPrimMediaControls::updateShape()
294294
LLViewerMediaImpl* media_impl = getTargetMediaImpl();
295295
LLViewerObject* objectp = getTargetObject();
296296

297-
if(!media_impl || gFloaterTools->getVisible())
297+
if(!media_impl || (gFloaterTools && gFloaterTools->getVisible()))
298298
{
299299
setVisible(false);
300300
return;

indra/newview/llselectmgr.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7264,7 +7264,10 @@ void dialog_refresh_all()
72647264
// *TODO: Eliminate all calls into outside classes below, make those
72657265
// objects register with the update signal.
72667266

7267-
gFloaterTools->dirty();
7267+
if (gFloaterTools)
7268+
{
7269+
gFloaterTools->dirty();
7270+
}
72687271

72697272
gMenuObject->needsArrange();
72707273

indra/newview/lltoolbrush.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,10 @@ void LLToolBrushLand::handleSelect()
447447
{
448448
gEditMenuHandler = this;
449449

450-
gFloaterTools->setStatusText("modifyland");
450+
if (gFloaterTools)
451+
{
452+
gFloaterTools->setStatusText("modifyland");
453+
}
451454
// if (!mBrushSelected)
452455
{
453456
mBrushSelected = true;

indra/newview/lltooldraganddrop.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@ void LLToolDragAndDrop::dropMaterial(LLViewerObject* hit_obj,
12541254
// If user dropped a material onto face it implies
12551255
// applying texture now without cancel, save to selection
12561256
if (nodep
1257+
&& gFloaterTools
12571258
&& gFloaterTools->getVisible()
12581259
&& nodep->mSavedGLTFMaterialIds.size() > hit_face)
12591260
{
@@ -1429,10 +1430,10 @@ void LLToolDragAndDrop::dropTexture(LLViewerObject* hit_obj,
14291430

14301431
// If user dropped a texture onto face it implies
14311432
// applying texture now without cancel, save to selection
1432-
LLPanelFace* panel_face = gFloaterTools->getPanelFace();
1433+
LLPanelFace* panel_face = gFloaterTools ? gFloaterTools->getPanelFace() : nullptr;
14331434
if (nodep
1434-
&& gFloaterTools->getVisible()
14351435
&& panel_face
1436+
&& gFloaterTools->getVisible()
14361437
&& panel_face->getTextureDropChannel() == 0 /*texture*/
14371438
&& nodep->mSavedTextures.size() > hit_face)
14381439
{
@@ -1486,8 +1487,8 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj,
14861487
if (allow_adding_to_override)
14871488
{
14881489
LLGLTFMaterial::TextureInfo drop_channel = LLGLTFMaterial::GLTF_TEXTURE_INFO_BASE_COLOR;
1489-
LLPanelFace* panel_face = gFloaterTools->getPanelFace();
1490-
if (gFloaterTools->getVisible() && panel_face)
1490+
LLPanelFace* panel_face = gFloaterTools ? gFloaterTools->getPanelFace() : nullptr;
1491+
if (panel_face && gFloaterTools->getVisible())
14911492
{
14921493
drop_channel = panel_face->getPBRDropChannel();
14931494
}
@@ -1512,9 +1513,9 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj,
15121513

15131514
LLTextureEntry* tep = hit_obj->getTE(hit_face);
15141515

1515-
LLPanelFace* panel_face = gFloaterTools->getPanelFace();
1516+
LLPanelFace* panel_face = gFloaterTools ? gFloaterTools->getPanelFace() : nullptr;
15161517

1517-
if (gFloaterTools->getVisible() && panel_face)
1518+
if (panel_face && gFloaterTools->getVisible())
15181519
{
15191520
tex_channel = (tex_channel > -1) ? tex_channel : panel_face->getTextureDropChannel();
15201521
switch (tex_channel)
@@ -1609,7 +1610,10 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj,
16091610
}
16101611
}
16111612
hit_obj->saveScript(new_script, active, true);
1612-
gFloaterTools->dirty();
1613+
if (gFloaterTools)
1614+
{
1615+
gFloaterTools->dirty();
1616+
}
16131617

16141618
// VEFFECT: SetScript
16151619
LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, true);
@@ -1842,7 +1846,10 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj,
18421846
effectp->setTargetObject(hit_obj);
18431847
effectp->setDuration(LL_HUD_DUR_SHORT);
18441848
effectp->setColor(LLColor4U(gAgent.getEffectColor()));
1845-
gFloaterTools->dirty();
1849+
if (gFloaterTools)
1850+
{
1851+
gFloaterTools->dirty();
1852+
}
18461853
}
18471854

18481855
// accessor that looks at permissions, copyability, and names of

indra/newview/lltoolplacer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,10 @@ bool LLToolPlacer::handleHover(S32 x, S32 y, MASK mask)
533533

534534
void LLToolPlacer::handleSelect()
535535
{
536-
gFloaterTools->setStatusText("place");
536+
if (gFloaterTools)
537+
{
538+
gFloaterTools->setStatusText("place");
539+
}
537540
}
538541

539542
void LLToolPlacer::handleDeselect()

indra/newview/lltoolselectland.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ void LLToolSelectLand::render()
207207

208208
void LLToolSelectLand::handleSelect()
209209
{
210-
gFloaterTools->setStatusText("selectland");
210+
if (gFloaterTools)
211+
{
212+
gFloaterTools->setStatusText("selectland");
213+
}
211214
}
212215

213216

indra/newview/llviewermenu.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3283,7 +3283,11 @@ void handle_object_edit()
32833283
LLFloaterReg::showInstance("build");
32843284

32853285
LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
3286-
gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() );
3286+
3287+
if (gFloaterTools)
3288+
{
3289+
gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() );
3290+
}
32873291

32883292
LLViewerJoystick::getInstance()->moveObjects(true);
32893293
LLViewerJoystick::getInstance()->setNeedsReset(true);

indra/newview/llviewerobject.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
12901290
#endif
12911291
//clear cost and linkset cost
12921292
setObjectCostStale();
1293-
if (isSelected())
1293+
if (isSelected() && gFloaterTools)
12941294
{
12951295
gFloaterTools->dirty();
12961296
}
@@ -1729,7 +1729,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
17291729
#endif
17301730
setObjectCostStale();
17311731

1732-
if (isSelected())
1732+
if (isSelected() && gFloaterTools)
17331733
{
17341734
gFloaterTools->dirty();
17351735
}
@@ -3891,7 +3891,7 @@ void LLViewerObject::setObjectCost(F32 cost)
38913891
mObjectCost = cost;
38923892
mCostStale = false;
38933893

3894-
if (isSelected())
3894+
if (isSelected() && gFloaterTools)
38953895
{
38963896
gFloaterTools->dirty();
38973897
}
@@ -3911,7 +3911,7 @@ void LLViewerObject::setLinksetCost(F32 cost)
39113911
iter++;
39123912
}
39133913

3914-
if (needs_refresh)
3914+
if (needs_refresh && gFloaterTools)
39153915
{
39163916
gFloaterTools->dirty();
39173917
}
@@ -3922,7 +3922,7 @@ void LLViewerObject::setPhysicsCost(F32 cost)
39223922
mPhysicsCost = cost;
39233923
mCostStale = false;
39243924

3925-
if (isSelected())
3925+
if (isSelected() && gFloaterTools)
39263926
{
39273927
gFloaterTools->dirty();
39283928
}
@@ -3933,7 +3933,7 @@ void LLViewerObject::setLinksetPhysicsCost(F32 cost)
39333933
mLinksetPhysicsCost = cost;
39343934
mCostStale = false;
39353935

3936-
if (isSelected())
3936+
if (isSelected() && gFloaterTools)
39373937
{
39383938
gFloaterTools->dirty();
39393939
}

0 commit comments

Comments
 (0)