refcounting bugfix, gameOb.getParent() and gameOb.parent both added a reference when they should not have.
This commit is contained in:
@@ -1440,8 +1440,10 @@ PyObject* KX_GameObject::pyattr_get_parent(void *self_v, const KX_PYATTRIBUTE_DE
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
|
||||
KX_GameObject* parent = self->GetParent();
|
||||
if (parent)
|
||||
if (parent) {
|
||||
parent->Release(); /* self->GetParent() AddRef's */
|
||||
return parent->GetProxy();
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@@ -2148,8 +2150,10 @@ PyObject* KX_GameObject::PyGetParent()
|
||||
{
|
||||
ShowDeprecationWarning("getParent()", "the parent property");
|
||||
KX_GameObject* parent = this->GetParent();
|
||||
if (parent)
|
||||
if (parent) {
|
||||
parent->Release(); /* self->GetParent() AddRef's */
|
||||
return parent->GetProxy();
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user