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

Assigning QtCore.Property to Python variable leaks memory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.14.2
    • Fix Version/s: 5.15.1
    • Component/s: PySide
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      76d5ddebc281543294a330da3e56feea080581bb (pyside/pyside-setup/5.14)

      Description

      Assigning QtCore.Property to Python variable leaks memory.

      If TestObject which inherits QtCore.QObject has the following 'number' Property,

      @QtCore.Property(int, notify=numberChanged)
      def number(self):
      return self.GetNumber()

      Calling the property from Python leaks memory even though it does not leak if it is referred from QML nor if self.GetNumber() called directly.

      To be more precise, if obj = TestObject(), it behaves like below.

      temp0 = obj.number # This leaks (~1MB/cpusec)
      #temp1 = getattr(obj,'number') # This leaks (~1MB/cpusec)
      #temp2 = obj.GetNumber() # This does not leak

      I attached a minimum script to reproduce.

        Attachments

        1. pyside1321_minimum.py
          1 kB
        2. pyside1321_noquick.py
          1 kB
        3. pyside1321_valgrind.txt
          675 kB
        4. pyside1321.zip
          1 kB
        5. test.zip
          0.9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kleint Friedemann Kleint
            Reporter:
            tohge Norihito Tohge
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes