Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-05-11 19:01:24 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-05-12 11:35:49 +0300
commitc1d8eb01c50f2b3777333edfa9eefb2255765f34 (patch)
treea7f9b6575330353bd9c3c794f9260d5d7730e804 /source/blender/editors/gpencil
parent24140444f2fb92292f93abbb472613d6cf7700a9 (diff)
GPencil: Cleanup wrong ID delete
Differential Revision: https://developer.blender.org/D7691
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index a3f6e10ccb0..0f57862efb2 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -45,6 +45,7 @@
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_image.h"
+#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_paint.h"
@@ -1360,19 +1361,9 @@ static void gpencil_fill_exit(bContext *C, wmOperator *op)
ED_region_draw_cb_exit(tgpf->region->type, tgpf->draw_handle_3d);
}
- /* delete temp image */
+ /* Delete temp image. */
if (tgpf->ima) {
- for (Image *ima = bmain->images.first; ima; ima = ima->id.next) {
- if (ima == tgpf->ima) {
- /* XXX This is super, super suspicious!
- * There should NEVER be any need to handle datablocks in Main in such custom code.
- * Please change to using BKE_id_free() or similar! */
- BLI_remlink(&bmain->images, ima);
- BKE_image_free(tgpf->ima);
- MEM_SAFE_FREE(tgpf->ima);
- break;
- }
- }
+ BKE_id_free(bmain, tgpf->ima);
}
/* finally, free memory used by temp data */