summaryrefslogtreecommitdiffstats
path: root/libpyside/pysideqflags.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libpyside/pysideqflags.cpp')
-rw-r--r--libpyside/pysideqflags.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/libpyside/pysideqflags.cpp b/libpyside/pysideqflags.cpp
index 4fe24b8..39f8b04 100644
--- a/libpyside/pysideqflags.cpp
+++ b/libpyside/pysideqflags.cpp
@@ -39,7 +39,7 @@ extern "C" {
#define PYSIDE_QFLAGS(X) reinterpret_cast<PySideQFlagsObject*>(X)
- PyObject* PySideQFlagsNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
+ PyObject* PySideQFlagsNew(PyTypeObject* type, PyObject* args, PyObject* kwds)
{
long val = 0;
if (PyTuple_GET_SIZE(args)) {
@@ -61,13 +61,11 @@ extern "C" {
static long getNumberValue(PyObject* v)
{
- PyObject* number = PyNumber_Long(v);
- long result = PyLong_AsLong(number);
- Py_XDECREF(number);
- return result;
+ Shiboken::AutoDecRef number(PyNumber_Long(v));
+ return PyLong_AsLong(number);
}
- PyObject* PySideQFlagsRichCompare(PyObject *self, PyObject *other, int op)
+ PyObject* PySideQFlagsRichCompare(PyObject* self, PyObject* other, int op)
{
int result = 0;
if (!PyNumber_Check(other)) {