aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2019-06-09 17:13:28 +0200
committerChristian Tismer <tismer@stackless.com>2019-06-10 15:14:19 +0200
commit6108df521065e3a4628ae5656c3cbfd281b6765d (patch)
tree64308d61760d13db079b1f360788aa0a19627315 /sources/pyside2/PySide2
parentf54fc43bb466cb588cdb47edd08a86979d5b4e90 (diff)
Fix negative refcount on QSocketNotifier
Change 43451e3bc17467593df64cb73ce8c0bf9e60045f from 2018-05-09 introduced a refcount bug that was not caught because we do not build with debug Python. This also revealed an omission in the patch "PySide: Allow any existing attribute in the constructor" when debug Python is used. Change-Id: Idbcbbc87f0a83bb696d03e05af0cf616b21f7335 Fixes: PYSIDE-1027 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2')
-rw-r--r--sources/pyside2/PySide2/glue/qtcore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp
index fde016548..f30607f6b 100644
--- a/sources/pyside2/PySide2/glue/qtcore.cpp
+++ b/sources/pyside2/PySide2/glue/qtcore.cpp
@@ -1211,8 +1211,8 @@ QByteArray ba(1 + int(%2), char(0));
// @snippet qcryptographichash-adddata
// @snippet qsocketnotifier
-Shiboken::AutoDecRef socket(%PYARG_1);
-if (!socket.isNull()) {
+PyObject *socket = %PYARG_1;
+if (socket != nullptr) {
// We use qintptr as PyLong, but we check for int
// since it is currently an alias to be Python2 compatible.
// Internally, ints are qlonglongs.