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