Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-07-27 00:20:25 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-07-27 00:20:25 +0400
commit52f639277b527b97eb29f3f91e0f5899fd30d8a2 (patch)
tree3d60453c68f4cfa896d67a900a2d825455a093e9 /source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp
parent69853d3e409470aebda5732daf3e525231d317e6 (diff)
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.
Diffstat (limited to 'source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp')
-rw-r--r--source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp
index 44bf1c5d563..18da07c5bfb 100644
--- a/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp
+++ b/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp
@@ -157,7 +157,8 @@ int UnaryFunction1DUnsigned___init__(BPy_UnaryFunction1DUnsigned* self, PyObject
}
void UnaryFunction1DUnsigned___dealloc__(BPy_UnaryFunction1DUnsigned* self)
{
- delete self->uf1D_unsigned;
+ if (self->uf1D_unsigned)
+ delete self->uf1D_unsigned;
UnaryFunction1D_Type.tp_dealloc((PyObject*)self);
}