Forgot to add 'ForgetReference' for game-python objects.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user