diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/simulation.cc | 1 | ||||
-rw-r--r-- | source/blender/simulation/intern/simulation_solver.cc | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc index 95340e4e29c..ac9c13e157c 100644 --- a/source/blender/blenkernel/intern/simulation.cc +++ b/source/blender/blenkernel/intern/simulation.cc @@ -112,6 +112,7 @@ static void simulation_copy_data(Main *bmain, ID *id_dst, const ID *id_src, cons BKE_simulation_state_copy_data(state_src, state_dst); } + BLI_listbase_clear(&simulation_dst->persistent_data_handles); BLI_duplicatelist(&simulation_dst->persistent_data_handles, &simulation_src->persistent_data_handles); } diff --git a/source/blender/simulation/intern/simulation_solver.cc b/source/blender/simulation/intern/simulation_solver.cc index ee7a8d40035..1628d9cac15 100644 --- a/source/blender/simulation/intern/simulation_solver.cc +++ b/source/blender/simulation/intern/simulation_solver.cc @@ -257,6 +257,7 @@ static void update_persistent_data_handles(Simulation &simulation, PersistentDataHandleItem *, handle_item, &simulation.persistent_data_handles) { if (handle_item->id == nullptr) { BLI_remlink(&simulation.persistent_data_handles, handle_item); + MEM_freeN(handle_item); continue; } if (!used_data_blocks.contains(handle_item->id)) { |