From 6108df521065e3a4628ae5656c3cbfd281b6765d Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Sun, 9 Jun 2019 17:13:28 +0200 Subject: 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 Reviewed-by: Cristian Maureira-Fredes --- sources/pyside2/libpyside/pyside.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'sources/pyside2/libpyside/pyside.cpp') diff --git a/sources/pyside2/libpyside/pyside.cpp b/sources/pyside2/libpyside/pyside.cpp index 170a3587f..fff28a9e7 100644 --- a/sources/pyside2/libpyside/pyside.cpp +++ b/sources/pyside2/libpyside/pyside.cpp @@ -108,6 +108,7 @@ static bool _setProperty(PyObject* qObj, PyObject *name, PyObject *value, bool * if (retval.isNull()) return false; } else { + PyErr_Clear(); Shiboken::AutoDecRef attr(PyObject_GenericGetAttr(qObj, name)); if (PySide::Property::checkType(attr)) { *accept = true; -- cgit v1.2.3