- //remove the cached renderer from the cache if we and the cache are the only things that hold a reference to it
- if( mImpl->mCachedRenderer && mImpl->mCachedRenderer->ReferenceCount() == 2 )
- {
- mFactoryCache.RemoveRenderer( mImpl->mCachedRenderer->mKey );
- }
- mImpl->mCachedRenderer.Reset();
+ //clean the renderer from the cache since it may no longer be in use
+ mFactoryCache.CleanRendererCache( mImpl->mCachedRendererKey );