Skip to content

Commit

Permalink
Try to see if issue #7 still triggers.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmtroffaes committed Sep 14, 2024
1 parent f3325f8 commit 6668a90
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cython/pycddlib.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,7 @@ cdef class Polyhedron:
raise TypeError("This class cannot be instantiated directly.")

def __dealloc__(self):
if self.dd_poly:
dd_FreePolyhedra(self.dd_poly)
dd_FreePolyhedra(self.dd_poly)
self.dd_poly = NULL

cdef polyhedron_from_ptr(dd_PolyhedraPtr dd_poly):
Expand All @@ -429,7 +428,7 @@ def polyhedron_from_matrix(Matrix mat):
if dd_poly == NULL:
raise MemoryError
if error != dd_NoError:
# TODO should call dd_FreePolyhedra(dd_poly)... see issue #7
dd_FreePolyhedra(dd_poly)
_raise_error(error, "failed to load polyhedra")
return polyhedron_from_ptr(dd_poly)

Expand Down

0 comments on commit 6668a90

Please sign in to comment.