aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Herrmann <adrian.herrmann@qt.io>2023-06-02 17:28:46 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-06-03 12:36:54 +0200
commit80da3a11d0faade9baed726f90bd44cf38ce811b (patch)
tree41dc4a2f68c8d461d5761930e38600d33949e414
parentcc2054bc13ac91da50e3e796e107f12883176314 (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. Fixes: PYSIDE-2346 Task-number: PYSIDE-2299 Change-Id: I1dcddb03f731a333f6acf7c9df79b9dba42bec21 Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit 0bf8ce7022f55dd816f5f0c3e8209f515e411c76) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--build_history/blacklist.txt4
-rw-r--r--sources/pyside6/libpyside/globalreceiverv2.cpp11
2 files changed, 5 insertions, 10 deletions
diff --git a/build_history/blacklist.txt b/build_history/blacklist.txt
index 475e5d40e..1da2b0ca0 100644
--- a/build_history/blacklist.txt
+++ b/build_history/blacklist.txt
@@ -6,6 +6,10 @@
linux
darwin
win32
+[signals::anonymous_slot_leak_test]
+ linux
+ darwin
+ win32
[Qt3DExtras::qt3dextras_test]
win32 ci
linux
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()