diff options
author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-05-24 16:57:55 +0200 |
---|---|---|
committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-05-25 08:31:01 +0000 |
commit | cc2054bc13ac91da50e3e796e107f12883176314 (patch) | |
tree | 52ad2159f414bdcf3b309b2622f4f078dd78c4f7 /sources/pyside6 | |
parent | a16a93028d757eb3041c47cb69a896dc5770f077 (diff) |
Leak fix: special consideration for functools.partialv6.5.1
- Amends 5b39b316e3c9e40cdc0784538b8d5f290e41d67b until
proper fix is deviced.
Pick-to: 6.5 dev
Task-number: PYSIDE-2299
Change-Id: Ia4ace136cb44d092691fdfd030de1889f1d3c671
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6')
-rw-r--r-- | sources/pyside6/libpyside/globalreceiverv2.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/globalreceiverv2.cpp b/sources/pyside6/libpyside/globalreceiverv2.cpp index c623d05fa..b8c542eb1 100644 --- a/sources/pyside6/libpyside/globalreceiverv2.cpp +++ b/sources/pyside6/libpyside/globalreceiverv2.cpp @@ -110,6 +110,11 @@ GlobalReceiverKey DynamicSlotDataV2::key(PyObject *callback) // 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)}; } |