[Marble-bugs] [marble] [Bug 341922] Segmentation fault during regular observing

Bernhard Beschow bbeschow at cs.tu-berlin.de
Fri Dec 19 23:03:36 UTC 2014


https://bugs.kde.org/show_bug.cgi?id=341922

Bernhard Beschow <bbeschow at cs.tu-berlin.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bbeschow at cs.tu-berlin.de

--- Comment #1 from Bernhard Beschow <bbeschow at cs.tu-berlin.de> ---
Hints for fixing the fixing the crash:

d->m_forecastWeather.remove( it.key() );

deletes the object pointed to by the iterator "it". As a result, the iterator
becomes invalid such that operations like ++ on it are undefined, i.e. illegal.
Since QMap::remove() doesn't return a valid iterator, QMap::erase() could be
used instead, which "returns an iterator to the next item in the map". This
iterator should be used in the next round of the loop.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Marble-bugs mailing list