summaryrefslogtreecommitdiff
path: root/indra/newview/lllandmarklist.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-04-23 00:22:31 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-04-23 17:48:48 +0300
commitbe7f6b857547e008500b56a9838b5df72b0b49cd (patch)
treea20e4bf4ce8f70345a6156f5dc8b6e89da03c5b0 /indra/newview/lllandmarklist.cpp
parent1b900651f193c3750b51b9e945797e1f6d3c63f5 (diff)
SL-14956 Fix landmarks sometimes staying in mLoadedCallbackMap #2
Improved fix
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);