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:
authorJulian Eisel <eiseljulian@gmail.com>2019-12-10 17:45:55 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-12-10 18:00:43 +0300
commitc5767a24b9eeb167995c425cc76597c103caf7db (patch)
tree89dcbe32444d42640603a4b226c9c8841bb62a97 /source/blender/blenkernel/intern/paint_toolslots.c
parent4d0643a1857ff36272a858065a0c8a28f31812c8 (diff)
Fix T71995: Texture Paint workspace crash with new scene
Issue likely caused by 8b31f6fb2169. With this, initializing the toolsystem (e.g. for a new workspace-scene combination) would skip the entire create->initialize routine for image/texture painting settings. Reason being that these are not allocated, unlike other paint settings. So while correctly skipping the create part, it also skipped the initialization, which was still needed. This does further changes in related code to avoid NULL pointer accesses.
Diffstat (limited to 'source/blender/blenkernel/intern/paint_toolslots.c')
-rw-r--r--source/blender/blenkernel/intern/paint_toolslots.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/paint_toolslots.c b/source/blender/blenkernel/intern/paint_toolslots.c
index a252329b635..1d10db06139 100644
--- a/source/blender/blenkernel/intern/paint_toolslots.c
+++ b/source/blender/blenkernel/intern/paint_toolslots.c
@@ -94,7 +94,9 @@ void BKE_paint_toolslots_brush_update_ex(Paint *paint, Brush *brush)
BKE_paint_toolslots_len_ensure(paint, slot_index + 1);
PaintToolSlot *tslot = &paint->tool_slots[slot_index];
id_us_plus(&brush->id);
- id_us_min(&tslot->brush->id);
+ if (tslot->brush) {
+ id_us_min(&tslot->brush->id);
+ }
tslot->brush = brush;
}