summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2011-04-22 01:07:52 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2011-04-22 01:07:52 +0300
commite26bfe00ef467a65eb126a75fa2aba6ccd5cd07a (patch)
tree39487eeb76f3067c3bc967d70890e2165735d801 /indra/llmessage
parent120f31502eb521c1e0abaeb24972f070e7f75bd6 (diff)
STORM-380 FIXED Added syncing animations and sounds before the gesture starts playing.
The actual playing of animations and sounds of a gesture starts only when all needed animations and sound files are loaded into viewer cache. This reduces the delay between animations and sounds meant to be played simultaneously but may increase the delay between the moment a gesture is triggered and the moment it starts playing. Fixed calling assets callback to clean up the void pointer in getAssetData() and avoid potential memory leaks.
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llassetstorage.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 27a368df3d..69d092de76 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -398,6 +398,12 @@ BOOL LLAssetStorage::hasLocalAsset(const LLUUID &uuid, const LLAssetType::EType
bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAssetType::EType type,
LLGetAssetCallback callback, void *user_data)
{
+ if (user_data)
+ {
+ // The *user_data should not be passed without a callback to clean it up.
+ llassert(callback != NULL)
+ }
+
BOOL exists = mStaticVFS->getExists(uuid, type);
if (exists)
{
@@ -432,15 +438,26 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, LL
llinfos << "ASSET_TRACE requesting " << uuid << " type " << LLAssetType::lookup(type) << llendl;
+ if (user_data)
+ {
+ // The *user_data should not be passed without a callback to clean it up.
+ llassert(callback != NULL)
+ }
+
if (mShutDown)
{
llinfos << "ASSET_TRACE cancelled " << uuid << " type " << LLAssetType::lookup(type) << " shutting down" << llendl;
- return; // don't get the asset or do any callbacks, we are shutting down
+
+ if (callback)
+ {
+ callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_NONE);
+ }
+ return;
}
-
+
if (uuid.isNull())
{
- // Special case early out for NULL uuid
+ // Special case early out for NULL uuid and for shutting down
if (callback)
{
callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);