namespace //Unnamed namespace
{
//Memory pool used to allocate new texture sets. Memory used by this pool will be released when shutting down DALi
-Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::TextureSet> gTextureSetMemoryPool;
+Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::TextureSet>& GetTextureSetMemoryPool()
+{
+ static Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::TextureSet> gTextureSetMemoryPool;
+ return gTextureSetMemoryPool;
+}
} // namespace
namespace Dali
{
TextureSet* TextureSet::New()
{
- return new(gTextureSetMemoryPool.AllocateRawThreadSafe()) TextureSet();
+ return new(GetTextureSetMemoryPool().AllocateRawThreadSafe()) TextureSet();
}
TextureSet::TextureSet()
void TextureSet::operator delete(void* ptr)
{
- gTextureSetMemoryPool.FreeThreadSafe(static_cast<TextureSet*>(ptr));
+ GetTextureSetMemoryPool().FreeThreadSafe(static_cast<TextureSet*>(ptr));
}
void TextureSet::SetSampler(uint32_t index, Render::Sampler* sampler)
uint32_t TextureSet::GetMemoryPoolCapacity()
{
- return gTextureSetMemoryPool.GetCapacity();
+ return GetTextureSetMemoryPool().GetCapacity();
}
} // namespace SceneGraph