Copy-on-write data blocks could be referenced from python but were not properly managing python reference counting.
This would leak memory for any evaluated data-blocks accessed by Python.
Differential D12850
Fix T92136: Leak accessing evaluated depsgraph data from Python Authored by Campbell Barton (campbellbarton) on Oct 13 2021, 12:40 PM. Tags Subscribers None
Details Copy-on-write data blocks could be referenced from python but were not properly managing python reference counting. This would leak memory for any evaluated data-blocks accessed by Python.
Diff Detail
Event TimelineComment Actions Changes in the deg_expand_copy_on_write_datablock should not be needed after D12852: the function is supposed to be always used on an iD in a non-expanded state, and the py_instance will be taken care of via the Backup. I suggest verify the D12852, land it first (if verification passes), and simplify this patch.
Comment Actions
Comment Actions I would expect that changes in deg_expand_copy_on_write_datablock would not be needed with D12852: the deg_expand_copy_on_write_datablock is used on either non-yet-expanded or on a freed datablock. There should be no python reference at that point. Comment Actions Ah, right, if it's not expanded it will have no Python reference, updated P2495 & add assert to ensure the Python reference is NULL. | ||||||||||||||||||||||