Comment 2 for bug 1514928

Revision history for this message
Andrea Bernabei (faenil) wrote :

I confirm the bug.

I spent some time debugging it, I found out the following:
the main problem is that ItemParentHasChanged arrives to ListItem *after* setSelected is called. That means UCViewItemsAttachedPrivate::get(listItem) returns a QObject(0x0),
hence UCViewItemsAttachedPrivate::get(listItem)->addToSelected(q) is called on an uninitialized object.
addToSelected then calls selectedList.contains(<whatever>),
but selectedList is an uninitialized object at that point (note: even though it sits on the stack) because it is part of the state of the object UCViewItemsAttachedPrivate, which is uninitialized, and that makes selectedItem.contains(<whatever>) implementation lead to the crash.