• T.J. Corona's avatar
    Properly handle memory between C++ and Python for operations · 1b41edc3
    T.J. Corona authored
    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.
    1b41edc3
ImportPythonOperation.cxx 6.44 KB