Details
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
Issue Links
- relates to
-
PYSIDE-2453 garbage collection fails when using QtCore.Property
- Reported
For Gerrit Dashboard: PYSIDE-1321 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
303516,2 | Fix some leaks in enumeration creation | 5.15 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
303601,2 | Fix leaking reference in PySide2 property getter | 5.14 | pyside/pyside-setup | Status: MERGED | +2 | 0 |