diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-02-18 20:15:00 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-02-18 20:15:00 +0300 |
commit | 16a290bb6fd8e9b16c10b92328ad60d451ec5e2c (patch) | |
tree | 5e9b1902c9ba2b39da733eab3fc9fc6fbccff0ca /source/blender/depsgraph | |
parent | 49c7b345471b0d369305d5a143d487842d23ed6c (diff) |
Fix Object bbox memleak in depsgraph code.
Caused by rBae2b677dcb5a70f5, Object.runtime has lot of weird specific
handlings in depsgraph...
For now modified `deg_backup_object_runtime()` and
`deg_restore_object_runtime()` to mimic previous behavior regarding
Object bbox (i.e. pass it around, instead of wiping it clean).
Reported in T61660.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index f3a56cd9de1..7775a2b3cd2 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -815,6 +815,8 @@ static void deg_backup_object_runtime( Mesh *mesh_eval = object->runtime.mesh_eval; object_runtime_backup->runtime = object->runtime; BKE_object_runtime_reset(object); + /* Keep bbox (for now at least...). */ + object->runtime.bb = object_runtime_backup->runtime.bb; /* Object update will override actual object->data to an evaluated version. * Need to make sure we don't have data set to evaluated one before free * anything. */ @@ -831,8 +833,10 @@ static void deg_restore_object_runtime( const ObjectRuntimeBackup *object_runtime_backup) { Mesh *mesh_orig = object->runtime.mesh_orig; + BoundBox *bb = object->runtime.bb; object->runtime = object_runtime_backup->runtime; object->runtime.mesh_orig = mesh_orig; + object->runtime.bb = bb; if (object->type == OB_MESH && object->runtime.mesh_eval != NULL) { if (object->id.recalc & ID_RECALC_GEOMETRY) { /* If geometry is tagged for update it means, that part of |