Tomato: fixed crash caused by interaction between color management and
[blender.git] / intern / memutil / MEM_CacheLimiter.h
index e90e002b28cf8a25bb3cf06b632a2b4987eb7cf7..bc92f9b5af85ef57a8425074d723d408949cfe8f 100644 (file)
@@ -254,7 +254,8 @@ private:
                        MEM_CacheElementPtr elem = *it;
                        int priority;
 
-                       priority = i;
+                       /* by default 0 means higherst priority element */
+                       priority = queue.size() - i - 1;
 
                        if (getItemPriority) {
                                priority = getItemPriority(elem->get()->get_data(), priority);