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 652 - Segfault when using QTextBlock::setUserData due to missing ownership transfer
: Segfault when using QTextBlock::setUserData due to missing ownership transfer
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: PySide
: HEAD
: All All
: P2 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-01-27 22:57 EET by Andy Kittner
Modified: 2011-02-17 19:18 EET (History)
9 users (show)

See Also:


Attachments
patch o fix the segfault (701 bytes, patch)
2011-01-27 22:59 EET, Andy Kittner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Kittner 2011-01-27 22:57:06 EET
When attaching user data to a QTextBlock a segfault occurs if no other
reference is kept around. The attached patch fixes this issue by transfering
the ownership in the same way that QSyntaxHighlighter::setCurrentBlockData does
Comment 1 Andy Kittner 2011-01-27 22:59:35 EET
Created attachment 240 [details]
patch o fix the segfault
Comment 2 Matti Airas 2011-01-28 10:00:28 EET
Thanks for the bug report. Coincidentally, the same issue was reported some 8
hours earlier in bug 646, so I'm marking this a duplicate... No, scratch that,
there's a patch included -- I'm making this the "primary" bug and prioritizing
P2.
Comment 3 Matti Airas 2011-01-28 10:01:12 EET
*** Bug 646 has been marked as a duplicate of this bug. ***
Comment 4 Hugo Parente Lima 2011-02-02 15:18:13 EET
I think just a ownership transer wont do the job, because we need to recover
the exact type when the user later call QTextBlock::userData(), I also don't
know if a parent rule will solve this because QTextBlock is a value type copied
around without PySide get known about.
Comment 5 Hugo Parente Lima 2011-02-02 16:54:55 EET
the parent tag did the trick, I'll merge the fix on mainline soon.
Comment 6 Hugo Parente Lima 2011-02-02 20:42:19 EET
Fixed in commit:
pyside/295b965d3c38dcd13e6d0dcd5ffd34275b1757ff
Comment 7 Hugo Parente Lima 2011-02-17 19:18:18 EET
Released in 1.0.0~rc1