summaryrefslogtreecommitdiff
path: root/indra/newview/lllandmarklist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lllandmarklist.cpp')
-rw-r--r--indra/newview/lllandmarklist.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp
index b88ef39a07..88d3f2c5b6 100644
--- a/indra/newview/lllandmarklist.cpp
+++ b/indra/newview/lllandmarklist.cpp
@@ -162,6 +162,16 @@ void LLLandmarkList::processGetAssetReply(
gLandmarkList.makeCallbacks(uuid);
}
}
+ else
+ {
+ // failed to parse, shouldn't happen
+ gLandmarkList.eraseCallbacks(uuid);
+ }
+ }
+ else
+ {
+ // got a good status, but no file, shouldn't happen
+ gLandmarkList.eraseCallbacks(uuid);
}
}
else
@@ -180,7 +190,7 @@ void LLLandmarkList::processGetAssetReply(
gLandmarkList.mBadList.insert(uuid);
gLandmarkList.mRequestedList.erase(uuid); //mBadList effectively blocks any load, so no point keeping id in requests
- // todo: this should clean mLoadedCallbackMap!
+ gLandmarkList.eraseCallbacks(uuid);
}
// getAssetData can fire callback immediately, causing
@@ -220,19 +230,32 @@ BOOL LLLandmarkList::assetExists(const LLUUID& asset_uuid)
void LLLandmarkList::onRegionHandle(const LLUUID& landmark_id)
{
LLLandmark* landmark = getAsset(landmark_id);
+ if (!landmark)
+ {
+ LL_WARNS() << "Got region handle but the landmark " << landmark_id << " not found." << LL_ENDL;
+ eraseCallbacks(landmark_id);
+ return;
+ }
// Calculate landmark global position.
// This should succeed since the region handle is available.
LLVector3d pos;
- if (landmark && !landmark->getGlobalPos(pos))
+ if (!landmark->getGlobalPos(pos))
{
- LL_WARNS() << "Got region handle but the landmark " << landmark_id << " global position is still unknown." << LL_ENDL;
+ LL_WARNS() << "Got region handle but the landmark " << landmark_id << " global position is still unknown." << LL_ENDL;
+ eraseCallbacks(landmark_id);
+ return;
}
// Call this even if no landmark exists to clean mLoadedCallbackMap
makeCallbacks(landmark_id);
}
+void LLLandmarkList::eraseCallbacks(const LLUUID& landmark_id)
+{
+ mLoadedCallbackMap.erase(landmark_id);
+}
+
void LLLandmarkList::makeCallbacks(const LLUUID& landmark_id)
{
LLLandmark* landmark = getAsset(landmark_id);