X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftexture-manager-impl.cpp;h=bf78d250949cce9bb714b97e44abd0f291d5071a;hp=a2381e84e54761142eee055350554339219b9e28;hb=4b11a25bb26aeb1eaef96ac024de6009a790387f;hpb=8e97be241012322eff10c2511e0eb6f80d75dcbb diff --git a/dali-toolkit/internal/visuals/texture-manager-impl.cpp b/dali-toolkit/internal/visuals/texture-manager-impl.cpp index a2381e8..bf78d25 100644 --- a/dali-toolkit/internal/visuals/texture-manager-impl.cpp +++ b/dali-toolkit/internal/visuals/texture-manager-impl.cpp @@ -467,7 +467,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal( return textureId; } -void TextureManager::Remove( const TextureManager::TextureId textureId ) +void TextureManager::Remove( const TextureManager::TextureId textureId, TextureUploadObserver* observer ) { int textureInfoIndex = GetCacheIndexFromId( textureId ); if( textureInfoIndex != INVALID_INDEX ) @@ -475,9 +475,9 @@ void TextureManager::Remove( const TextureManager::TextureId textureId ) TextureInfo& textureInfo( mTextureInfoContainer[ textureInfoIndex ] ); DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, - "TextureManager::Remove(%d) url:%s\n cacheIdx:%d loadState:%s\n", + "TextureManager::Remove(%d) url:%s\n cacheIdx:%d loadState:%s reference count = %d\n", textureId, textureInfo.url.GetUrl().c_str(), - textureInfoIndex, GET_LOAD_STATE_STRING( textureInfo.loadState ) ); + textureInfoIndex, GET_LOAD_STATE_STRING( textureInfo.loadState ), textureInfo.referenceCount ); // Decrement the reference count and check if this is the last user of this Texture. if( --textureInfo.referenceCount <= 0 ) @@ -514,6 +514,19 @@ void TextureManager::Remove( const TextureManager::TextureId textureId ) mTextureInfoContainer.erase( mTextureInfoContainer.begin() + textureInfoIndex ); } } + + if( observer ) + { + // Remove element from the LoadQueue + for( auto&& element : mLoadQueue ) + { + if( element.mObserver == observer ) + { + mLoadQueue.Erase( &element ); + break; + } + } + } } } @@ -791,7 +804,7 @@ void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingCo } else { - Remove( textureInfo.textureId ); + Remove( textureInfo.textureId, nullptr ); } } }