Anti-Aliasing of BorderRenderer
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / image-atlas / image-load-thread.cpp
index d106690..c7da85b 100644 (file)
@@ -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 );