summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llagentcamera.cpp2
-rw-r--r--indra/newview/llagentwearables.cpp4
-rw-r--r--indra/newview/llappearancemgr.cpp2
-rw-r--r--indra/newview/llsidepanelappearance.cpp2
-rw-r--r--indra/newview/llviewerjointattachment.cpp16
-rw-r--r--indra/newview/llviewerjointattachment.h2
-rw-r--r--indra/newview/llviewermenu.cpp8
-rw-r--r--indra/newview/llviewerobjectlist.cpp2
-rw-r--r--indra/newview/llvoavatar.cpp68
-rw-r--r--indra/newview/pipeline.cpp2
10 files changed, 56 insertions, 52 deletions
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index fd8797481d..ab1aea82c3 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -1455,7 +1455,7 @@ void LLAgentCamera::updateCamera()
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject *attached_object = (*attachment_iter);
+ LLViewerObject *attached_object = attachment_iter->get();
if (attached_object && !attached_object->isDead() && attached_object->mDrawable.notNull())
{
// clear any existing "early" movements of attachment
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 15e4de8f69..013c40f557 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1323,7 +1323,7 @@ void LLAgentWearables::findAttachmentsAddRemoveInfo(LLInventoryModel::item_array
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject *objectp = (*attachment_iter);
+ LLViewerObject *objectp = attachment_iter->get();
if (objectp)
{
LLUUID object_item_id = objectp->getAttachmentItemID();
@@ -1387,7 +1387,7 @@ std::vector<LLViewerObject*> LLAgentWearables::getTempAttachments()
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject *objectp = (*attachment_iter);
+ LLViewerObject *objectp = attachment_iter->get();
if (objectp && objectp->isTempAttachment())
{
temp_attachs.push_back(objectp);
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 22bcbad7da..fe438e8772 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2911,7 +2911,7 @@ void LLAppearanceMgr::removeAllAttachmentsFromAvatar()
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject *attached_object = (*attachment_iter);
+ LLViewerObject *attached_object = attachment_iter->get();
if (attached_object)
{
objects_to_remove.push_back(attached_object);
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 4ebcffa554..6e2b4a00fc 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -485,7 +485,7 @@ void LLSidepanelAppearance::fetchInventory()
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject* attached_object = (*attachment_iter);
+ LLViewerObject* attached_object = attachment_iter->get();
if (!attached_object) continue;
const LLUUID& item_id = attached_object->getAttachmentItemID();
if (item_id.isNull()) continue;
diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp
index cf9243a871..8a597ed7e6 100644
--- a/indra/newview/llviewerjointattachment.cpp
+++ b/indra/newview/llviewerjointattachment.cpp
@@ -225,7 +225,7 @@ void LLViewerJointAttachment::removeObject(LLViewerObject *object)
iter != mAttachedObjects.end();
++iter)
{
- LLViewerObject *attached_object = (*iter);
+ LLViewerObject *attached_object = iter->get();
if (attached_object == object)
{
break;
@@ -327,7 +327,7 @@ void LLViewerJointAttachment::setAttachmentVisibility(BOOL visible)
iter != mAttachedObjects.end();
++iter)
{
- LLViewerObject *attached_obj = (*iter);
+ LLViewerObject *attached_obj = iter->get();
if (!attached_obj || attached_obj->mDrawable.isNull() ||
!(attached_obj->mDrawable->getSpatialBridge()))
continue;
@@ -366,7 +366,7 @@ S32 LLViewerJointAttachment::getNumAnimatedObjects() const
iter != mAttachedObjects.end();
++iter)
{
- const LLViewerObject *attached_object = *iter;
+ const LLViewerObject *attached_object = iter->get();
if (attached_object->isAnimatedObject())
{
count++;
@@ -384,7 +384,7 @@ void LLViewerJointAttachment::clampObjectPosition()
iter != mAttachedObjects.end();
++iter)
{
- if (LLViewerObject *attached_object = (*iter))
+ if (LLViewerObject *attached_object = iter->get())
{
// *NOTE: object can drift when hitting maximum radius
LLVector3 attachmentPos = attached_object->getPosition();
@@ -406,7 +406,7 @@ void LLViewerJointAttachment::calcLOD()
iter != mAttachedObjects.end();
++iter)
{
- if (LLViewerObject *attached_object = (*iter))
+ if (LLViewerObject *attached_object = iter->get())
{
maxarea = llmax(maxarea,attached_object->getMaxScale() * attached_object->getMidScale());
LLViewerObject::const_child_list_t& child_list = attached_object->getChildren();
@@ -445,7 +445,7 @@ BOOL LLViewerJointAttachment::isObjectAttached(const LLViewerObject *viewer_obje
iter != mAttachedObjects.end();
++iter)
{
- const LLViewerObject* attached_object = (*iter);
+ const LLViewerObject* attached_object = iter->get();
if (attached_object == viewer_object)
{
return TRUE;
@@ -460,7 +460,7 @@ const LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &o
iter != mAttachedObjects.end();
++iter)
{
- const LLViewerObject* attached_object = (*iter);
+ const LLViewerObject* attached_object = iter->get();
if (attached_object->getAttachmentItemID() == object_id)
{
return attached_object;
@@ -475,7 +475,7 @@ LLViewerObject *LLViewerJointAttachment::getAttachedObject(const LLUUID &object_
iter != mAttachedObjects.end();
++iter)
{
- LLViewerObject* attached_object = (*iter);
+ LLViewerObject* attached_object = iter->get();
if (attached_object->getAttachmentItemID() == object_id)
{
return attached_object;
diff --git a/indra/newview/llviewerjointattachment.h b/indra/newview/llviewerjointattachment.h
index 9641ab4208..e5edf2c06b 100644
--- a/indra/newview/llviewerjointattachment.h
+++ b/indra/newview/llviewerjointattachment.h
@@ -95,7 +95,7 @@ public:
LLViewerObject *getAttachedObject(const LLUUID &object_id);
// list of attachments for this joint
- typedef std::vector<LLViewerObject *> attachedobjs_vec_t;
+ typedef std::vector<LLPointer<LLViewerObject> > attachedobjs_vec_t;
attachedobjs_vec_t mAttachedObjects;
protected:
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 1566736f17..f20dda5f8e 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6840,7 +6840,7 @@ class LLAttachmentDetachFromPoint : public view_listener_t
iter != attachment->mAttachedObjects.end();
iter++)
{
- LLViewerObject *attached_object = (*iter);
+ LLViewerObject *attached_object = iter->get();
ids_to_remove.push_back(attached_object->getAttachmentItemID());
}
}
@@ -6866,7 +6866,7 @@ static bool onEnableAttachmentLabel(LLUICtrl* ctrl, const LLSD& data)
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- const LLViewerObject* attached_object = (*attachment_iter);
+ const LLViewerObject* attached_object = attachment_iter->get();
if (attached_object)
{
LLViewerInventoryItem* itemp = gInventory.getItem(attached_object->getAttachmentItemID());
@@ -6979,7 +6979,7 @@ class LLAttachmentEnableDrop : public view_listener_t
{
// make sure item is in your inventory (it could be a delayed attach message being sent from the sim)
// so check to see if the item is in the inventory already
- item = gInventory.getItem((*attachment_iter)->getAttachmentItemID());
+ item = gInventory.getItem(attachment_iter->get()->getAttachmentItemID());
if (!item)
{
// Item does not exist, make an observer to enable the pie menu
@@ -7361,7 +7361,7 @@ void handle_dump_attachments(void*)
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject *attached_object = (*attachment_iter);
+ LLViewerObject *attached_object = attachment_iter->get();
BOOL visible = (attached_object != NULL &&
attached_object->mDrawable.notNull() &&
!attached_object->mDrawable->isRenderType(0));
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 2bf04dc204..63e48d1dd0 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1921,7 +1921,7 @@ void LLViewerObjectList::generatePickList(LLCamera &camera)
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- if (LLViewerObject* attached_object = (*attachment_iter))
+ if (LLViewerObject* attached_object = attachment_iter->get())
{
mSelectPickList.insert(attached_object);
LLViewerObject::const_child_list_t& child_list = attached_object->getChildren();
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index a974c66ee4..74cc1c63aa 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1377,7 +1377,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
++attachment_iter)
{
// Don't we need to look at children of attached_object as well?
- const LLViewerObject* attached_object = (*attachment_iter);
+ const LLViewerObject* attached_object = attachment_iter->get();
if (attached_object && !attached_object->isHUDAttachment())
{
const LLVOVolume *vol = dynamic_cast<const LLVOVolume*>(attached_object);
@@ -1800,7 +1800,7 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject* attached_object = (*attachment_iter);
+ LLViewerObject* attached_object = attachment_iter->get();
if (attached_object && !attached_object->isDead() && attachment->getValid())
{
@@ -1864,7 +1864,7 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject* attached_object = (*attachment_iter);
+ LLViewerObject* attached_object = attachment_iter->get();
if (attached_object->lineSegmentIntersect(start, local_end, face, pick_transparent, pick_rigged, face_hit, &local_intersection, tex_coord, normal, tangent))
{
@@ -2688,7 +2688,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject* attached_object = (*attachment_iter);
+ LLViewerObject* attached_object = attachment_iter->get();
BOOL visibleAttachment = visible || (attached_object &&
!(attached_object->mDrawable->getSpatialBridge() &&
attached_object->mDrawable->getSpatialBridge()->getRadius() < 2.0));
@@ -4569,7 +4569,7 @@ void LLVOAvatar::updateVisibility()
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- if (LLViewerObject *attached_object = (*attachment_iter))
+ if (LLViewerObject *attached_object = attachment_iter->get())
{
if(attached_object->mDrawable->isVisible())
{
@@ -5993,7 +5993,7 @@ void LLVOAvatar::rebuildAttachmentOverrides()
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator at_it = attachment_pt->mAttachedObjects.begin();
at_it != attachment_pt->mAttachedObjects.end(); ++at_it)
{
- LLViewerObject *vo = *at_it;
+ LLViewerObject *vo = at_it->get();
// Attached animated objects affect joints in their control
// avs, not the avs to which they are attached.
if (vo && !vo->isAnimatedObject())
@@ -6044,7 +6044,7 @@ void LLVOAvatar::updateAttachmentOverrides()
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator at_it = attachment_pt->mAttachedObjects.begin();
at_it != attachment_pt->mAttachedObjects.end(); ++at_it)
{
- LLViewerObject *vo = *at_it;
+ LLViewerObject *vo = at_it->get();
// Attached animated objects affect joints in their control
// avs, not the avs to which they are attached.
if (vo && !vo->isAnimatedObject())
@@ -7147,29 +7147,33 @@ void LLVOAvatar::lazyAttach()
for (U32 i = 0; i < mPendingAttachment.size(); i++)
{
LLPointer<LLViewerObject> cur_attachment = mPendingAttachment[i];
- if (cur_attachment->mDrawable)
+ // Object might have died while we were waiting for drawable
+ if (!cur_attachment->isDead())
{
- if (isSelf())
+ if (cur_attachment->mDrawable)
{
- const LLUUID& item_id = cur_attachment->getAttachmentItemID();
- LLViewerInventoryItem *item = gInventory.getItem(item_id);
- LL_DEBUGS("Avatar") << "ATT attaching object "
- << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL;
+ if (isSelf())
+ {
+ const LLUUID& item_id = cur_attachment->getAttachmentItemID();
+ LLViewerInventoryItem *item = gInventory.getItem(item_id);
+ LL_DEBUGS("Avatar") << "ATT attaching object "
+ << (item ? item->getName() : "UNKNOWN") << " id " << item_id << LL_ENDL;
+ }
+ if (!attachObject(cur_attachment))
+ { // Drop it
+ LL_WARNS() << "attachObject() failed for "
+ << cur_attachment->getID()
+ << " item " << cur_attachment->getAttachmentItemID()
+ << LL_ENDL;
+ // MAINT-3312 backout
+ //still_pending.push_back(cur_attachment);
+ }
}
- if (!attachObject(cur_attachment))
- { // Drop it
- LL_WARNS() << "attachObject() failed for "
- << cur_attachment->getID()
- << " item " << cur_attachment->getAttachmentItemID()
- << LL_ENDL;
- // MAINT-3312 backout
- //still_pending.push_back(cur_attachment);
+ else
+ {
+ still_pending.push_back(cur_attachment);
}
}
- else
- {
- still_pending.push_back(cur_attachment);
- }
}
mPendingAttachment = still_pending;
@@ -7189,7 +7193,7 @@ void LLVOAvatar::resetHUDAttachments()
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- const LLViewerObject* attached_object = (*attachment_iter);
+ const LLViewerObject* attached_object = attachment_iter->get();
if (attached_object && attached_object->mDrawable.notNull())
{
gPipeline.markMoved(attached_object->mDrawable);
@@ -7519,7 +7523,7 @@ LLViewerObject * LLVOAvatar::findAttachmentByID( const LLUUID & target_id ) cons
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject *attached_object = (*attachment_iter);
+ LLViewerObject *attached_object = attachment_iter->get();
if (attached_object &&
attached_object->getID() == target_id)
{
@@ -7941,7 +7945,7 @@ void LLVOAvatar::updateMeshVisibility()
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject *objectp = (*attachment_iter);
+ LLViewerObject *objectp = attachment_iter->get();
if (objectp)
{
for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++)
@@ -8258,7 +8262,7 @@ void LLVOAvatar::updateMeshTextures()
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject* attached_object = (*attachment_iter);
+ LLViewerObject* attached_object = attachment_iter->get();
if (attached_object && !attached_object->isDead())
{
attached_object->refreshBakeTexture();
@@ -8496,7 +8500,7 @@ LLBBox LLVOAvatar::getHUDBBox() const
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- const LLViewerObject* attached_object = (*attachment_iter);
+ const LLViewerObject* attached_object = attachment_iter->get();
if (attached_object == NULL)
{
LL_WARNS() << "HUD attached object is NULL!" << LL_ENDL;
@@ -9862,7 +9866,7 @@ void LLVOAvatar::getAssociatedVolumes(std::vector<LLVOVolume*>& volumes)
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attach_iter = attachment->mAttachedObjects.begin();
attach_iter != attach_end; ++attach_iter)
{
- LLViewerObject* attached_object = *attach_iter;
+ LLViewerObject* attached_object = attach_iter->get();
LLVOVolume *volume = dynamic_cast<LLVOVolume*>(attached_object);
if (volume)
{
@@ -10380,7 +10384,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- const LLViewerObject* attached_object = (*attachment_iter);
+ const LLViewerObject* attached_object = attachment_iter->get();
accountRenderComplexityForObject(attached_object, max_attachment_complexity,
textures, cost, hud_complexity_list);
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index bd73c234a6..bc5b3534c7 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -11434,7 +11434,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar)
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- if (LLViewerObject* attached_object = (*attachment_iter))
+ if (LLViewerObject* attached_object = attachment_iter->get())
{
markVisible(attached_object->mDrawable->getSpatialBridge(), *viewer_camera);
}