Fix #124216: "Remove Hook" operator causes crash with geometry nodes

It looks like the "user edited flag propagation" node built for the geometry
nodes modifier is unchanged after modifiers are removed. My guess is this
is now a more general problem when modifiers are removed-- I guess the
depsgraph nodes for an object have to be rebuilt when that happens now.

Maybe there is a more general fix, but to fix the crash mentioned in the
report, I tagged the depsgraph for a relations update, which rebuilds the
problematic modifier node.

Pull Request: https://projects.blender.org/blender/blender/pulls/124252
This commit is contained in:
Hans Goudey 2024-07-05 19:35:03 +02:00 committed by Hans Goudey
parent fd06a407e1
commit b9edd2e02e

@ -719,6 +719,7 @@ static int object_hook_remove_exec(bContext *C, wmOperator *op)
BKE_modifier_remove_from_list(ob, (ModifierData *)hmd);
BKE_modifier_free((ModifierData *)hmd);
DEG_relations_tag_update(CTX_data_main(C));
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);