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 507 - Segfault when returning a new QObject instance that falls out of scope
: Segfault when returning a new QObject instance that falls out of scope
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P2 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-11-29 18:06 EET by Thomas Perl
Modified: 2010-12-20 11:26 EET (History)
8 users (show)

See Also:


Attachments
test case (1005 bytes, application/x-gzip)
2010-11-29 18:06 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:06:52 EET
Created attachment 161 [details]
test case

See example code.

Basically, when I return a new instance of my custom QObject subclass, it seems
to get freed when it falls out of scope, and therefore it segfaults. When I
leak a reference to the object I'm returning (i.e. as attribute to the list
model), this problem is worked around.

The object should be kept alive as long as the caller needs it, but should be
freed after that.

By default, the attached code crashes with PySide Git HEAD. If you set
"enable_leaking = True", a reference to the object is saved as attribute in the
model, thereby avoiding it being freed at return time.

(Sorry for the confusing explanation, the code should make things clear ;)
Comment 1 Matti Airas 2010-11-30 04:20:48 EET
Thanks. Segfaults shouldn't happen - prioritizing P2 so that the issue will be
taken care of ASAP.
Comment 2 Marcelo Lira 2010-12-17 13:36:53 EET
Fixed in commits Shiboken/81423ee9 and PySide/634cde19.
Comment 3 Marcelo Lira 2010-12-17 14:02:39 EET
Final test for this bug added in PySide/ca914c9f.
Comment 4 Hugo Parente Lima 2010-12-20 11:26:09 EET
Closign bugs after release of 1.0.0 beta2.