[Bf-blender-cvs] [e949ac0bfc4] master: Cleanup: unset 'FILE_ENTRY_PREVIEW_LOADING' at the end

Germano Cavalcante noreply at git.blender.org
Sat Nov 20 14:34:36 CET 2021


Commit: e949ac0bfc4c64040e6ac425989e833c19b3e26c
Author: Germano Cavalcante
Date:   Sat Nov 20 10:34:29 2021 -0300
Branches: master
https://developer.blender.org/rBe949ac0bfc4c64040e6ac425989e833c19b3e26c

Cleanup: unset 'FILE_ENTRY_PREVIEW_LOADING' at the end

Although this function only runs on the main thread, it seems safer to
clear the flag only after setting the result.

===================================================================

M	source/blender/editors/space_file/filelist.c

===================================================================

diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index b85dadf1f8e..6f929c43e13 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -2661,7 +2661,6 @@ bool filelist_cache_previews_update(FileList *filelist)
     //      printf("%s: %d - %s - %p\n", __func__, preview->index, preview->path, preview->img);
 
     if (entry) {
-      entry->flags &= ~FILE_ENTRY_PREVIEW_LOADING;
       if (preview->icon_id) {
         /* The FILE_ENTRY_PREVIEW_LOADING flag should have prevented any other asynchronous
          * process from trying to generate the same preview icon. */
@@ -2678,6 +2677,7 @@ bool filelist_cache_previews_update(FileList *filelist)
          * preview will be retried quite often anyway. */
         entry->flags |= FILE_ENTRY_INVALID_PREVIEW;
       }
+      entry->flags &= ~FILE_ENTRY_PREVIEW_LOADING;
     }
     else {
       BKE_icon_delete(preview->icon_id);



More information about the Bf-blender-cvs mailing list