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:
authorErwin Coumans <blender@erwincoumans.com>2005-12-20 12:13:06 +0300
committerErwin Coumans <blender@erwincoumans.com>2005-12-20 12:13:06 +0300
commitd59531226f8fc18bf666c49f1786e8d0a6ac0889 (patch)
tree495dfd7071aa2cf5778bf312a902f2d6aee04d25 /source/gameengine/Expressions
parent73fa63751fc50d153a8d06a25fa71a71a2132932 (diff)
Forgot to add 'ForgetReference' for game-python objects.
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp6
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h14
2 files changed, 13 insertions, 7 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index b75da2c12a2..55cd76824c9 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -77,6 +77,12 @@ PyTypeObject PyObjectPlus::Type = {
0, /*tp_call */
};
+PyObjectPlus::~PyObjectPlus()
+{
+ _Py_ForgetReference(this);
+// assert(ob_refcnt==0);
+}
+
PyObjectPlus::PyObjectPlus(PyTypeObject *T) // constructor
{
MT_assert(T != NULL);
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index c261012a3bc..026a58cdbca 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -136,18 +136,18 @@ class PyObjectPlus : public PyObject
public:
PyObjectPlus(PyTypeObject *T);
- virtual ~PyObjectPlus() {}; // destructor
+ virtual ~PyObjectPlus(); // destructor
static void PyDestructor(PyObject *P) // python wrapper
{
delete ((PyObjectPlus *) P);
};
- //void INCREF(void) {
- // Py_INCREF(this);
- // }; // incref method
- //void DECREF(void) {
- // Py_DECREF(this);
- // }; // decref method
+// void INCREF(void) {
+// Py_INCREF(this);
+// }; // incref method
+// void DECREF(void) {
+// Py_DECREF(this);
+// }; // decref method
virtual PyObject *_getattr(const STR_String& attr); // _getattr method
static PyObject *__getattr(PyObject * PyObj, char *attr) // This should be the entry in Type.