Hey Stefan, Op 26 april 2012 18:23 heeft Stefan Ruppert <[email protected]> het volgende geschreven: > Hi Koen, > > today I had some time to debug the crashes with large tree views. In > fact I think I have found a serious bug within WStandardItem class. > > Currently I'm using a WStandardItemModel which is populated with a huge > tree. The I use a WSortFilterProxyModel model to support filtering and > sorting on that tree. Now whenever a new tree is loaded the old tree is > removed be calling removeRows() on the source model. This will result in > calling WStandardItem::removeRows() method. And here is a bug during > removing rows in conjunction with a WSortFilterProxyModel:
... > Here all removed items are deleted before the endRemoveRows() signal is > emitted. But within the endRemoveRows() signal the WSortFilterProxyModel > removes its source WModelIndex instance which in turn will use the > deleted WStandardItem instances!!! It is legitimate for WStandardItem to delete the items that are in the affected rows before calling endRemoveRows(). However, endRemoveRows() should not need to "use" these indexes any more (which means: access any of its methods -- the object itself is harmless). WSortFilterProxyModel should not touch these, and indeed WSortFilterProxyModel::sourceRowsRemoved() doesn from a first reading seem to do this -- it doesn't do anything that is communicated to its connected View(s), nor does it try to dereference a model index in the region that was deleted ? When you get the assert, could you get a complete stack trace to see how sourceRowsRemoved() is part of it ? Regards, koen ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
