PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 508 - qmltopy1 crashes when setContextProperty is called twice without keeping a reference
: qmltopy1 crashes when setContextProperty is called twice without keeping a re...
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtDeclarative
: HEAD
: All All
: P2 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2010-11-29 18:15 EET by Thomas Perl
Modified: 2010-12-20 11:26 EET (History)
8 users (show)

See Also:


Attachments
Test case: Modified qmltopy1 from pyside-examples (2.43 KB, application/x-gzip)
2010-11-29 18:15 EET, Thomas Perl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Perl 2010-11-29 18:15:29 EET
Created attachment 162 [details]
Test case: Modified qmltopy1 from pyside-examples

Similar to bug 507, when I set an Object as context property of a declarative
view root context, I expect it to keep a reference to the object, even if it
falls out of scope in the Python world.

It seems like a reference to the last object is kept somewhere (in
setContextProperty?), but as soon as it is called twice, the first object gets
dereferenced(?) and freed.

Attached is a modified version of the qmltopy1 example application from
pyside-examples. It crashes upon pressing the button, because the first
instance of Console is freed when setContextProperty() is called the second
time (if you set "enable_crashing = False", it won't be called a second time,
and it will still work).
Comment 1 Matti Airas 2010-11-30 04:22:00 EET
Also P2.
Comment 2 Hugo Parente Lima 2010-12-14 17:03:40 EET
Fixed in commit:
pyside/44d4d96ec35d3236b211788ef7f264c6d1a2a299

Yes, the reference was stored and removed when the method was called twice, now
it stores one reference per context name.

Thanks for the report =]
Comment 3 Hugo Parente Lima 2010-12-20 11:26:10 EET
Closign bugs after release of 1.0.0 beta2.