Issue 93809 - sfx2: usage of invalidated iterator
Summary: sfx2: usage of invalidated iterator
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: DEV300m30
Hardware: PC (x86_64) Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.0.1
QA Contact: issues@framework
Depends on:
Reported: 2008-09-12 08:18 UTC by dtardon
Modified: 2008-11-27 17:25 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---

Splits the removal into two steps: 1. remove items from m_xParent 2. clean vec . (1.30 KB, patch)
2008-09-12 08:24 UTC, dtardon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description dtardon 2008-09-12 08:18:59 UTC
There is a for loop in SfxDocumentMetaData::setMetaList() which goes through a
vector in reverse (using it's reverse_iterator) and removes all it's elements
from it (by means of pop_back) and from another structure. But, AFAIK,
pop_back() invalidates iterators pointing to popped element; thus, the loop
iterator's base() is invalidated and so is the iterator itself.
Comment 1 dtardon 2008-09-12 08:24:03 UTC
Created attachment 56458 [details]
Splits the removal into two steps: 1. remove items from m_xParent 2. clean vec .
Comment 2 2008-09-15 11:39:10 UTC
hi dtardon,

i've applied your patch in cws fwk94.
though according to the notes on it
shouldn't be necessary; but maybe the c++ standard differs from the sgi
documentation, so better be on the safe side...
Comment 3 2008-09-15 11:42:57 UTC
oh, forgot to grab the issue...
Comment 4 2008-10-06 11:47:54 UTC
Comment 5 caolanm 2008-11-27 17:25:24 UTC
Integrated DEV300m36/OOO300m12