eina - thread queue - fix block pool shutdown
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 16 Jul 2014 07:14:41 +0000 (16:14 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 16 Jul 2014 11:43:32 +0000 (20:43 +0900)
src/lib/eina/eina_thread_queue.c

index 3a999aaade8cd1cc95579ba3fc93e9dff0979484..d36669e2dc68734b9dbe38e00acb0f500be07b4f 100644 (file)
@@ -160,14 +160,15 @@ _eina_thread_queue_msg_block_pool_shutdown(void)
    eina_spinlock_take(&(_eina_thread_queue_block_pool_lock));
    while (_eina_thread_queue_block_pool)
      {
-        Eina_Thread_Queue_Msg_Block *blk;
+        Eina_Thread_Queue_Msg_Block *blk, *blknext;
 
         for (;;)
           {
              blk = _eina_thread_queue_block_pool;
              if (!blk) break;
+             blknext = blk->next;
              _eina_thread_queue_msg_block_real_free(blk);
-             _eina_thread_queue_block_pool = blk->next;
+             _eina_thread_queue_block_pool = blknext;
           }
      }
    eina_spinlock_free(&_eina_thread_queue_block_pool_lock);