From 74dc4e87a6df2826f26eb94eaff8fe02a3911c24 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 4 May 2015 18:02:56 +1000 Subject: Fix Buttons context, invalid object data access Another instance of T44376. Crash where the Python context would access a stale pointer to the active object. --- source/blender/editors/space_buttons/buttons_context.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/editors/space_buttons') diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index b00a2c54ff9..bc42f1dd5bb 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1183,6 +1183,11 @@ ID *buttons_context_id_path(const bContext *C) void ED_buttons_id_unref(SpaceButs *sbuts, const ID *id) { + if (sbuts->pinid == id) { + sbuts->pinid = NULL; + sbuts->flag &= ~SB_PIN_CONTEXT; + } + if (sbuts->path) { ButsContextPath *path = sbuts->path; int i; -- cgit v1.2.3