[Bf-blender-cvs] [25c0666b901] master: Fix potentially dnagerous code in doversionning of brush.

Bastien Montagne noreply at git.blender.org
Thu Jun 15 15:49:16 CEST 2017


Commit: 25c0666b901d8a083e79d606b5bd805ee18fee20
Author: Bastien Montagne
Date:   Thu Jun 15 12:38:55 2017 +0200
Branches: master
https://developer.blender.org/rB25c0666b901d8a083e79d606b5bd805ee18fee20

Fix potentially dnagerous code in doversionning of brush.

Even though in that specific it was probably safe-ish, there is no
guarantee at this point Brush we want to remove are not used somewhere,
better take the slightly slower, much safer `BKE_libblock_delete()` path here.

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

M	source/blender/blenloader/intern/versioning_defaults.c

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

diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index e34f12b1cf9..e7e0054e7a1 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -242,13 +242,13 @@ void BLO_update_defaults_startup_blend(Main *bmain)
 		/* remove polish brush (flatten/contrast does the same) */
 		br = (Brush *)BKE_libblock_find_name_ex(bmain, ID_BR, "Polish");
 		if (br) {
-			BKE_libblock_free(bmain, br);
+			BKE_libblock_delete(bmain, br);
 		}
 
 		/* remove brush brush (huh?) from some modes (draw brushes do the same) */
 		br = (Brush *)BKE_libblock_find_name_ex(bmain, ID_BR, "Brush");
 		if (br) {
-			BKE_libblock_free(bmain, br);
+			BKE_libblock_delete(bmain, br);
 		}
 
 		/* remove draw brush from texpaint (draw brushes do the same) */




More information about the Bf-blender-cvs mailing list