mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-29 10:39:47 +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);
|
||||
}
|
||||
|
||||
~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.
|
||||
bool fromVariant(const QVariant& variant);
|
||||
@ -116,7 +116,7 @@ public:
|
||||
//! sets the object and passes the ownership (stealing the reference, in Python slang)
|
||||
void setNewRef(PyObject* o) {
|
||||
if (o != _object) {
|
||||
if (_object) Py_DECREF(_object);
|
||||
if (_object) { Py_DECREF(_object); }
|
||||
_object = o;
|
||||
}
|
||||
}
|
||||
@ -157,9 +157,9 @@ protected:
|
||||
|
||||
void setObject(PyObject* o) {
|
||||
if (o != _object) {
|
||||
if (_object) Py_DECREF(_object);
|
||||
if (_object) { Py_DECREF(_object); }
|
||||
_object = o;
|
||||
if (_object) Py_INCREF(_object);
|
||||
if (_object) { Py_INCREF(_object); }
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,4 +171,4 @@ private:
|
||||
// register it to the meta type system
|
||||
Q_DECLARE_METATYPE(PythonQtObjectPtr)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user