Skip to content

Properly handle memory between C++ and Python for operations

T.J. Corona requested to merge tjcorona/smtk:fix-python-operations into master

To allow smtk to manipulate Python operations as C++ objects, we originally held a reference to the Python operation within the C++ instance to prevent Python from garbage collecting the object. This resulted in a circular dependency where the Python object would never be deleted, causing memory overlap issues when multiple Python operations were used. This MR moves the logic for keeping the Python representation of an operation into a specialized typecaster for operations, breaking the cyclic dependency and allowing C++ and Python to safely free operations when they go out of scope.

Backport: release

Merge request reports