diff options
author | Adrian Herrmann <adrian.herrmann@qt.io> | 2023-06-02 17:28:46 +0200 |
---|---|---|
committer | Adrian Herrmann <adrian.herrmann@qt.io> | 2023-06-02 17:51:09 +0200 |
commit | 0bf8ce7022f55dd816f5f0c3e8209f515e411c76 (patch) | |
tree | 9aa606fb3531907b2b3e747b6c653dc1640bf6ca /sources/pyside6/libpyside/globalreceiverv2.cpp | |
parent | e3d5872887442793735cb85f5e8bee26eee4d88d (diff) |
Revert anonymous slot memory leak fix
The fix to PYSIDE-2299 unfortunately introduces regressions that are
more serious than the memory leak caused by an edge case that was
originally supposed to be fixed. A different approach will be needed to
fix the memory leak, in the meantime, revert the change. The
corresponding unit test remains blacklisted, as it will apply to a
future fix.
Pick-to: 6.5
Fixes: PYSIDE-2346
Task-number: PYSIDE-2299
Change-Id: I1dcddb03f731a333f6acf7c9df79b9dba42bec21
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/libpyside/globalreceiverv2.cpp')
-rw-r--r-- | sources/pyside6/libpyside/globalreceiverv2.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/sources/pyside6/libpyside/globalreceiverv2.cpp b/sources/pyside6/libpyside/globalreceiverv2.cpp index b8c542eb1..8289eaff6 100644 --- a/sources/pyside6/libpyside/globalreceiverv2.cpp +++ b/sources/pyside6/libpyside/globalreceiverv2.cpp @@ -106,16 +106,7 @@ GlobalReceiverKey DynamicSlotDataV2::key(PyObject *callback) Shiboken::AutoDecRef func(PyObject_GetAttr(callback, PySide::PySideName::im_func())); return {self, func}; } - // PYSIDE-2299: Callbacks can have the same code, but we only need one GlobalReceiverV2 for all - // of them. If we used the callback itself instead of the code object, we would - // create a new GlobalReceiverV2 for each in SignalManager::globalReceiver() - // (signalmanager.cpp), leaking memory. - - // TODO: Need proper fix. This is temporary - if (std::strcmp(Py_TYPE(callback)->tp_name, "functools.partial") == 0) - return {nullptr, callback}; - - return {nullptr, PyFunction_GetCode(callback)}; + return {nullptr, callback}; } PyObject *DynamicSlotDataV2::callback() |