We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a0d834 commit 40b12bbCopy full SHA for 40b12bb
src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
@@ -1169,8 +1169,8 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
1169
self._parent = <ParentWithBase>parent
1170
1171
def __dealloc__(self):
1172
- # for some mysterious reason, this may be NULL in some cases
1173
- if (<MPolynomialRing_libsingular>self._parent)._ring != NULL:
+ # for some mysterious reason, various things may be NULL in some cases
+ if self._parent is not <ParentWithBase>None and (<MPolynomialRing_libsingular>self._parent)._ring != NULL and self._poly != NULL:
1174
p_Delete(&self._poly, (<MPolynomialRing_libsingular>self._parent)._ring)
1175
1176
def __call__(self, *x):
0 commit comments