2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323...
[blender.git] / source / gameengine / Ketsji / KX_PyConstraintBinding.cpp
index fb37ede..2c65c18 100644 (file)
@@ -381,7 +381,7 @@ static PyObject* gPyGetVehicleConstraint(PyObject* self,
                        if (vehicle)
                        {
                                KX_VehicleWrapper* pyWrapper = new KX_VehicleWrapper(vehicle,PHY_GetActiveEnvironment());
-                               return pyWrapper;
+                               return pyWrapper->NewProxy(true);
                        }
 
                }
@@ -440,7 +440,7 @@ static PyObject* gPyCreateConstraint(PyObject* self,
                                KX_ConstraintWrapper* wrap = new KX_ConstraintWrapper((enum PHY_ConstraintType)constrainttype,constraintid,PHY_GetActiveEnvironment());
                                
 
-                               return wrap;
+                               return wrap->NewProxy(true);
                        }
                        
                        
@@ -582,6 +582,7 @@ PyObject*   initPythonConstraintBinding()
   d = PyModule_GetDict(m);
   ErrorObject = PyString_FromString("PhysicsConstraints.error");
   PyDict_SetItemString(d, "error", ErrorObject);
+  Py_DECREF(ErrorObject);
 
   // XXXX Add constants here