Details
Description
When use signal, the connected local function can not be destroyed by python
PYQT6.x not found this problem
import sys from PySide6.QtWidgets import * from PySide6.QtCore import * from PySide6.QtGui import * if __name__ == "__main__": app = QApplication(sys.argv) def func(): button = QPushButton() def onClicked(text): print("=========clicked button:", text) button.clicked.connect(partial(onClicked, "demo")) def _run(): import objgraph objgraph.show_growth() func() QTimer.singleShot(1000, _run) _run() app.exec()
Attachments
Issue Links
- relates to
-
PYSIDE-2299 REG->6.5: Memory/Reference Leak with connecting signals to lambda functions referencing "self"
- Closed
-
PYSIDE-2646 [REG: 6.2->6.5] Connections to lambda or nested function prevent destruction of objects they refer to
- Closed
- resulted from
-
PYSIDE-2141 Crash when connecting/disconnecting inherited slot
- Closed
For Gerrit Dashboard: PYSIDE-2371 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
487671,5 | PySide6/SignalManager: Fix memory leaks connecting free methods/lambdas | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
487672,2 | PySide6: Add debug operators for DynamicSlotDataV2/GlobalReceiverV2 | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
488119,2 | PySide6: Add debug operators for DynamicSlotDataV2/GlobalReceiverV2 | 6.5 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
488261,2 | PySide6/SignalManager: Fix memory leaks connecting free methods/lambdas | 6.5 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
488591,3 | Update changes-6.5.2 | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
488675,2 | Update changes-6.5.2 | 6.5 | pyside/pyside-setup | Status: MERGED | +2 | 0 |