Re: [Interest] QList and erase problem...

2015-09-14 Thread Julien Cugnière
2015-09-14 17:13 GMT+02:00 Igor Mironchik : > Hi, > > it seems that problem not in the iterating and deletion from cantainer... Yes it is. As Andre told you, erasing from the list invalidates iterators, including the one returned by end(). As you cache the "end" iterator in the "last" variable at

Re: [Interest] QList and erase problem...

2015-09-14 Thread Igor Mironchik
Look in while statement 9/14/2015 6:28 PM, Croitor Alexandru пишет: The documentation for QList::erase says: -- Removes the item associated with the iterator /pos/ from the list, and returns an iterator to the next item in the list (which may be end ()). Documentation for iterator::oper

Re: [Interest] QList and erase problem...

2015-09-14 Thread Croitor Alexandru
The documentation for QList::erase says: -- Removes the item associated with the iterator *pos* from the list, and returns an iterator to the next item in the list (which may be end ()). Documentation for iterator::operator++() says: Calling this function on QList::end () leads to undefined res

Re: [Interest] QList and erase problem...

2015-09-14 Thread william.croc...@analog.com
On 09/14/2015 11:13 AM, Igor Mironchik wrote: > Hi, > > it seems that problem not in the iterating and deletion from cantainer... > > I wrote simple test app and everything is ok. > > But something here crashes my app and only in release mode, so I can't > understand what is the problem... > > And

Re: [Interest] QList and erase problem...

2015-09-14 Thread Igor Mironchik
Hi, it seems that problem not in the iterating and deletion from cantainer... I wrote simple test app and everything is ok. But something here crashes my app and only in release mode, so I can't understand what is the problem... And ideas? 9/14/2015 6:06 PM, André Somers пишет: > Op 14-9-2015

Re: [Interest] QList and erase problem...

2015-09-14 Thread André Somers
Op 14-9-2015 om 16:57 schreef Igor Mironchik: > Hi, > > I ran into this problem... > > void > ImageFilesStoragePrivate::removeAllImages( > QList< ImageRecord > & images, > ImageFilesStorage::ImageType type ) > { > QList< ImageRecord >::Iterator it = images.begin(); > QList<

[Interest] QList and erase problem...

2015-09-14 Thread Igor Mironchik
Hi, I ran into this problem... void ImageFilesStoragePrivate::removeAllImages( QList< ImageRecord > & images, ImageFilesStorage::ImageType type ) { QList< ImageRecord >::Iterator it = images.begin(); QList< ImageRecord >::Iterator last = images.end(); while( it != last )