diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-25 16:33:12 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-25 16:33:12 +0200 |
commit | 39ac266455cc1c0ae970a47c34d3a6bc7372d750 (patch) | |
tree | 9577fe06bcb0e3096ef85af929a91eb37b037452 /sources/shiboken2/libshiboken/autodecref.h | |
parent | 9115712ef3a1be8b401c9cd306792dbc30c89bf0 (diff) | |
parent | 6717d3540fac74c91d9381958a08e60f6532d402 (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.14.2
Change-Id: Id0650ec2b46f3c67eb2c9b400f5b31aab98c3c58
Diffstat (limited to 'sources/shiboken2/libshiboken/autodecref.h')
-rw-r--r-- | sources/shiboken2/libshiboken/autodecref.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/shiboken2/libshiboken/autodecref.h b/sources/shiboken2/libshiboken/autodecref.h index d3353b1e4..498b1aec4 100644 --- a/sources/shiboken2/libshiboken/autodecref.h +++ b/sources/shiboken2/libshiboken/autodecref.h @@ -96,8 +96,10 @@ public: */ void reset(PyObject *other) { - Py_XDECREF(m_pyObj); + // Safely decref m_pyObj. See Py_XSETREF in object.h . + PyObject *_py_tmp = m_pyObj; m_pyObj = other; + Py_XDECREF(_py_tmp); } private: PyObject *m_pyObj; |