Skip to content

Commit

Permalink
[Python] Fix cleanup of Solution change callbacks
Browse files Browse the repository at this point in the history
Resolves a case where _SolutionBase objects that did not own the
underlying C++ Solution object were not de-registring their change
callbacks when the _SolutionBase object was being deleted.

Fixes #1489
  • Loading branch information
speth authored and ischoegl committed May 29, 2023
1 parent 0d449ca commit 2158ff9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions interfaces/cython/cantera/solutionbase.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ cdef class _SolutionBase:
if name is not None:
self.name = name

def __dealloc__(self):
if self._base:
self._base.get().removeChangedCallback(<PyObject*>self)
def __del__(self):
if self.base:
self.base.removeChangedCallback(<PyObject*>self)

property name:
"""
Expand Down

0 comments on commit 2158ff9

Please sign in to comment.