Forgot to add 'ForgetReference' for game-python objects.

This commit is contained in:
2005-12-20 09:13:06 +00:00
parent 73fa63751f
commit d59531226f
2 changed files with 13 additions and 7 deletions

View File

@@ -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);

View File

@@ -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.