Fix: crash when evaluating geometry nodes after deleting an unlinked node

This was essentially a use-after-free issue. When a geometry nodes
group changes it has to be preprocessed again before it can be evaluated.
This part was working, the issue was that parent node groups have to be
preprocessed as well, which was missing. The lazy-function graph cached
on the parent node group was still referencing data that was freed when
the child group changed.

Now the depsgraph makes sure that all relevant geometry node groups are
preprocessed again after a change.

This issue was found by Simon Thommes.
This commit is contained in:
2022-09-16 16:02:08 +02:00
parent 7042f4e4b2
commit 4d67a995d9
12 changed files with 60 additions and 20 deletions

View File

@@ -178,6 +178,9 @@ void deg_graph_build_finalize(Main *bmain, Depsgraph *graph)
if (GS(id_orig->name) == ID_OB) {
flag |= ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY;
}
if (GS(id_orig->name) == ID_NT) {
flag |= ID_RECALC_NTREE_OUTPUT;
}
}
/* Restore recalc flags from original ID, which could possibly contain recalc flags set by
* an operator and then were carried on by the undo system. */