From: Ferran Sole Date: Fri, 18 Dec 2015 11:49:03 +0000 (+0000) Subject: Bug fix FixedSizeMemoryPool X-Git-Tag: dali_1.1.15~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=208cac4abc1e5d85cfdc5f340ab455677a59aed2;p=platform%2Fcore%2Fuifw%2Fdali-core.git Bug fix FixedSizeMemoryPool Change-Id: Ie94f52f2f4cee7bad19bb83025b1a059e13df39e --- diff --git a/dali/internal/common/fixed-size-memory-pool.cpp b/dali/internal/common/fixed-size-memory-pool.cpp index 0594639..63e3f4b 100644 --- a/dali/internal/common/fixed-size-memory-pool.cpp +++ b/dali/internal/common/fixed-size-memory-pool.cpp @@ -151,8 +151,6 @@ FixedSizeMemoryPool::~FixedSizeMemoryPool() void* FixedSizeMemoryPool::Allocate() { - Mutex::ScopedLock( mImpl->mMutex ); - // First, recycle deleted objects if( mImpl->mDeletedObjects ) { @@ -177,8 +175,6 @@ void* FixedSizeMemoryPool::Allocate() void FixedSizeMemoryPool::Free( void* memory ) { - Mutex::ScopedLock( mImpl->mMutex ); - // Add memory to head of deleted objects list. Store next address in the same memory space as the old object. *( reinterpret_cast< void** >( memory ) ) = mImpl->mDeletedObjects; mImpl->mDeletedObjects = memory; @@ -186,13 +182,13 @@ void FixedSizeMemoryPool::Free( void* memory ) void* FixedSizeMemoryPool::AllocateThreadSafe() { - Mutex::ScopedLock( mImpl->mMutex ); + Mutex::ScopedLock lock( mImpl->mMutex ); return Allocate(); } void FixedSizeMemoryPool::FreeThreadSafe( void* memory ) { - Mutex::ScopedLock( mImpl->mMutex ); + Mutex::ScopedLock lock( mImpl->mMutex ); Free( memory ); }