Reduce the memory used by PySideMetaFunction instances.

This commit is contained in:
Hugo Parente Lima 2011-10-26 20:20:22 -02:00
commit 5c076e1c53

View file

@ -34,7 +34,7 @@ extern "C"
struct PySideMetaFunctionPrivate struct PySideMetaFunctionPrivate
{ {
QObject* qobject; QObject* qobject;
QMetaMethod method; int methodIndex;
}; };
//methods //methods
@ -101,7 +101,7 @@ PyObject* functionCall(PyObject* self, PyObject* args, PyObject* kw)
PySideMetaFunction* function = reinterpret_cast<PySideMetaFunction*>(self); PySideMetaFunction* function = reinterpret_cast<PySideMetaFunction*>(self);
PyObject* retVal; PyObject* retVal;
if (!PySide::MetaFunction::call(function->d->qobject, function->d->method.methodIndex(), args, &retVal)) if (!PySide::MetaFunction::call(function->d->qobject, function->d->methodIndex, args, &retVal))
return 0; return 0;
return retVal; return retVal;
} }
@ -129,7 +129,7 @@ PySideMetaFunction* newObject(QObject* source, int methodIndex)
PySideMetaFunction* function = PyObject_New(PySideMetaFunction, &PySideMetaFunctionType); PySideMetaFunction* function = PyObject_New(PySideMetaFunction, &PySideMetaFunctionType);
function->d = new PySideMetaFunctionPrivate(); function->d = new PySideMetaFunctionPrivate();
function->d->qobject = source; function->d->qobject = source;
function->d->method = method; function->d->methodIndex = methodIndex;
return function; return function;
} }
return 0; return 0;