diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-12-29 14:08:47 -0500 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-12-29 14:08:47 -0500 |
| commit | 93ee0b044f77ab07bb9df08bf52c9f4afa713caa (patch) | |
| tree | 08490033f3628dadb0073bf2b07d5e7af0ec1798 /indra/newview/llremoteparcelrequest.cpp | |
| parent | 28b628ab7b92243a6e40fcdf87f4e2c5b44150e7 (diff) | |
| parent | 8204145ab1c4b8f8a509db15f61bbdd264532508 (diff) | |
merge
Diffstat (limited to 'indra/newview/llremoteparcelrequest.cpp')
| -rw-r--r-- | indra/newview/llremoteparcelrequest.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index 0dff087553..e5ef51bdd1 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -140,22 +140,25 @@ void LLRemoteParcelInfoProcessor::processParcelInfoReply(LLMessageSystem* msg, v typedef std::vector<observer_multimap_t::iterator> deadlist_t; deadlist_t dead_iters; - observer_multimap_t::iterator oi; - observer_multimap_t::iterator start = observers.lower_bound(parcel_data.parcel_id); + observer_multimap_t::iterator oi = observers.lower_bound(parcel_data.parcel_id); observer_multimap_t::iterator end = observers.upper_bound(parcel_data.parcel_id); - for (oi = start; oi != end; ++oi) + while (oi != end) { - LLRemoteParcelInfoObserver * observer = oi->second.get(); + // increment the loop iterator now since it may become invalid below + observer_multimap_t::iterator cur_oi = oi++; + + LLRemoteParcelInfoObserver * observer = cur_oi->second.get(); if(observer) { + // may invalidate cur_oi if the observer removes itself observer->processParcelInfo(parcel_data); } else { // the handle points to an expired observer, so don't keep it // around anymore - dead_iters.push_back(oi); + dead_iters.push_back(cur_oi); } } |
