X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fimage-atlas%2Fimage-load-thread.cpp;h=c7da85b62922400d92a6dfe0234fb26e862b87ec;hp=d1066909a039cf3815eeea742e55be0914a7727e;hb=89e63b880b582ed7fddf40330136d2f2452b833b;hpb=75fdb5f9730fa6f6723c517691c9778fb646d082 diff --git a/dali-toolkit/internal/image-atlas/image-load-thread.cpp b/dali-toolkit/internal/image-atlas/image-load-thread.cpp index d106690..c7da85b 100644 --- a/dali-toolkit/internal/image-atlas/image-load-thread.cpp +++ b/dali-toolkit/internal/image-atlas/image-load-thread.cpp @@ -87,14 +87,14 @@ CompleteQueue::~CompleteQueue() LoadingTask* CompleteQueue::NextTask() { - while( mTasks.Empty() ) + // Lock while popping task out from the queue + Mutex::ScopedLock lock( mMutex ); + + if( mTasks.Empty() ) { return NULL; } - // Lock while popping task out from the queue - Mutex::ScopedLock lock( mMutex ); - Vector< LoadingTask* >::Iterator next = mTasks.Begin(); LoadingTask* nextTask = *next; mTasks.Erase( next );