Fix: Filter Mesh crash when using operator panel

`CTX_data_ensure_evaluated_depsgraph` ultimately ends up freeing the PBVH
meaning that any associated data still held may be a use-after-free error.

Pull Request: https://projects.blender.org/blender/blender/pulls/131011
This commit is contained in:
Sean Kim
2024-11-27 20:57:23 +01:00
committed by Sean Kim
parent a39bec7197
commit 4c1cb3be9d

View File

@@ -135,8 +135,8 @@ void cache_init(bContext *C,
float start_strength)
{
SculptSession &ss = *ob.sculpt;
bke::pbvh::Tree &pbvh = *bke::object::pbvh_get(ob);
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
bke::pbvh::Tree &pbvh = *bke::object::pbvh_get(ob);
ss.filter_cache = MEM_new<filter::Cache>(__func__);
ss.filter_cache->start_filter_strength = start_strength;