Cleanup: Correct order of guard and lock in moviecache_valfree

Fix own mistake in rB7061d1e39fe

In my attempt to quickly address T92838, along with the original bug, I
made a nonsensical choice to use the limiter lock to guard the check
against the cache item itself. While harmless, it is not necessary and
semantically wrong / potentially confusing to future readers of the code.

Differential Revision: https://developer.blender.org/D13122
This commit is contained in:
Jesse Yurkovich 2021-11-12 20:47:26 -08:00 committed by Philipp Oeser
parent ff5630b7fa
commit 0564b19ff4
Notes: blender-bot 2023-02-14 11:08:33 +01:00
Referenced by issue #93479, 3.0 Potential candidates for corrective releases
1 changed files with 2 additions and 2 deletions

View File

@ -122,11 +122,11 @@ static void moviecache_valfree(void *val)
PRINT("%s: cache '%s' free item %p buffer %p\n", __func__, cache->name, item, item->ibuf);
BLI_mutex_lock(&limitor_lock);
if (item->c_handle) {
BLI_mutex_lock(&limitor_lock);
MEM_CacheLimiter_unmanage(item->c_handle);
BLI_mutex_unlock(&limitor_lock);
}
BLI_mutex_unlock(&limitor_lock);
if (item->ibuf) {
IMB_freeImBuf(item->ibuf);