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