diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-13 13:29:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-13 13:29:30 +0300 |
commit | 8c0698460be9e435560b0b00474900492a614ac0 (patch) | |
tree | 17fd04320db9c3f48ba690995fe809e1829a0fc1 /source/blender/depsgraph | |
parent | f71d479556b23ac012cfcf90530a1d9740955349 (diff) |
Revert "Fix T92136: Leak accessing evaluated depsgraph data from Python"
This reverts commit 0558907ae674ebe81dc8910a6615fc32ce675d70.
Based on discussion with Sergey, having Python references to un-expanded
data should not happen - this change needs to be reconsidered.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc | 11 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc | 2 |
2 files changed, 0 insertions, 13 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 610e4860108..a844d23b558 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 @@ -853,10 +853,6 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, if (!deg_copy_on_write_is_needed(id_orig)) { return id_cow; } - /* Avoid removing & re-creating the reference if it exists. */ - void *py_instance = id_cow->py_instance; - id_cow->py_instance = nullptr; - DEG_COW_PRINT( "Expanding datablock for %s: id_orig=%p id_cow=%p\n", id_orig->name, id_orig, id_cow); /* Sanity checks. */ @@ -929,7 +925,6 @@ ID *deg_expand_copy_on_write_datablock(const Depsgraph *depsgraph, * from above. */ update_id_after_copy(depsgraph, id_node, id_orig, id_cow); id_cow->recalc = id_cow_recalc; - id_cow->py_instance = py_instance; return id_cow; } @@ -1047,11 +1042,6 @@ void discard_edit_mode_pointers(ID *id_cow) * - Does not free data-block itself. */ void deg_free_copy_on_write_datablock(ID *id_cow) { - /* There may be Python references to to shallow copies, see: T92136. */ - if (id_cow->py_instance) { - BKE_libblock_free_data_py(id_cow); - } - if (!check_datablock_expanded(id_cow)) { /* Actual content was never copied on top of CoW block, we have * nothing to free. */ @@ -1113,7 +1103,6 @@ void deg_tag_copy_on_write_id(ID *id_cow, const ID *id_orig) /* This ID is no longer localized, is a self-sustaining copy now. */ id_cow->tag &= ~LIB_TAG_LOCALIZED; id_cow->orig_id = (ID *)id_orig; - BLI_assert(id_cow->py_instance == nullptr); } bool deg_copy_on_write_is_expanded(const ID *id_cow) diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc index c6e3532aca9..7893e8c64c1 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc @@ -52,9 +52,7 @@ void RuntimeBackup::init_from_id(ID *id) } have_backup = true; - /* Clear, so freeing the expanded data doesn't remove this Python reference. */ id_data.py_instance = id->py_instance; - id->py_instance = nullptr; animation_backup.init_from_id(id); |