From e26bfe00ef467a65eb126a75fa2aba6ccd5cd07a Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 22 Apr 2011 01:07:52 +0300 Subject: 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. --- indra/llmessage/llassetstorage.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'indra/llmessage') 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); -- cgit v1.2.3