[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20118] trunk/blender/source/gameengine/ Ketsji/KX_GameObject.cpp: refcounting bugfix, gameOb.getParent() and gameOb .parent both added a reference when they should not have.

Campbell Barton ideasman42 at gmail.com
Sat May 9 18:29:04 CEST 2009


Revision: 20118
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20118
Author:   campbellbarton
Date:     2009-05-09 18:29:00 +0200 (Sat, 09 May 2009)

Log Message:
-----------
refcounting bugfix, gameOb.getParent() and gameOb.parent both added a reference when they should not have.

Modified Paths:
--------------
    trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp

Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp	2009-05-09 10:33:06 UTC (rev 20117)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp	2009-05-09 16:29:00 UTC (rev 20118)
@@ -1440,8 +1440,10 @@
 {
 	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 @@
 {
 	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;
 }
 





More information about the Bf-blender-cvs mailing list