Second attempt to fix a null pointer reference in deallocators of
built-in types (the first was in revision 21877). When an exception has raised within from the __init__ method of a user-defined class derived from a built-in type (e.g., UnaryPredicate0D and BinaryPredicate1D), some member variables of the base type are left uninitialized, leading to a null pointer reference in the "__dealloc__" function in the base type. To avoid this, pointer checking was added in the deallocators of those built-in types that can be used to define a subclass by a user.
This commit is contained in:
@@ -164,7 +164,8 @@ int BinaryPredicate1D___init__(BPy_BinaryPredicate1D *self, PyObject *args, PyOb
|
||||
|
||||
void BinaryPredicate1D___dealloc__(BPy_BinaryPredicate1D* self)
|
||||
{
|
||||
delete self->bp1D;
|
||||
if (self->bp1D)
|
||||
delete self->bp1D;
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user