Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2371

REG->6.5: Memory leak connecting signal to local function

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.5.2, 6.6.0
    • 6.4.0, 6.4.1, 6.5.0, 6.5.1, 6.4.2, 6.4.3, 6.5.1.1
    • PySide
    • None
    • Windows
    • f0109334c (dev), 7222d8a04 (6.5), 46ab90a5f (dev), afffc5838 (6.5), 2f37a27b3 (dev), 1c6a6a4e4 (6.5)

    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()
      

      test.zip

       

      Attachments

        1. pyside2371_diag.diff
          6 kB
        2. pyside2371_log.txt
          2 kB
        3. pyside2371.py
          1.0 kB
        4. test.zip
          38 kB
        5. testcode.png
          testcode.png
          244 kB

        Issue Links

          For Gerrit Dashboard: PYSIDE-2371
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              jerryhao_ jerry hao
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews