mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-30 11:04:57 +01:00
parent
5c6f9e625b
commit
bad7c7a47d
10
3rdparty/pythonqt/src/PythonQtObjectPtr.h
vendored
10
3rdparty/pythonqt/src/PythonQtObjectPtr.h
vendored
@ -67,7 +67,7 @@ public:
|
|||||||
if (o) Py_INCREF(_object);
|
if (o) Py_INCREF(_object);
|
||||||
}
|
}
|
||||||
|
|
||||||
~PythonQtObjectPtr() { if (_object) Py_DECREF(_object); }
|
~PythonQtObjectPtr() { if (_object) { Py_DECREF(_object); } }
|
||||||
|
|
||||||
//! If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference. This results in an increment of the reference count.
|
//! If the given variant holds a PythonQtObjectPtr, extract the value from it and hold onto the reference. This results in an increment of the reference count.
|
||||||
bool fromVariant(const QVariant& variant);
|
bool fromVariant(const QVariant& variant);
|
||||||
@ -116,7 +116,7 @@ public:
|
|||||||
//! sets the object and passes the ownership (stealing the reference, in Python slang)
|
//! sets the object and passes the ownership (stealing the reference, in Python slang)
|
||||||
void setNewRef(PyObject* o) {
|
void setNewRef(PyObject* o) {
|
||||||
if (o != _object) {
|
if (o != _object) {
|
||||||
if (_object) Py_DECREF(_object);
|
if (_object) { Py_DECREF(_object); }
|
||||||
_object = o;
|
_object = o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,9 +157,9 @@ protected:
|
|||||||
|
|
||||||
void setObject(PyObject* o) {
|
void setObject(PyObject* o) {
|
||||||
if (o != _object) {
|
if (o != _object) {
|
||||||
if (_object) Py_DECREF(_object);
|
if (_object) { Py_DECREF(_object); }
|
||||||
_object = o;
|
_object = o;
|
||||||
if (_object) Py_INCREF(_object);
|
if (_object) { Py_INCREF(_object); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,4 +171,4 @@ private:
|
|||||||
// register it to the meta type system
|
// register it to the meta type system
|
||||||
Q_DECLARE_METATYPE(PythonQtObjectPtr)
|
Q_DECLARE_METATYPE(PythonQtObjectPtr)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user