diff options
author | Kitty Barnett <develop@catznip.com> | 2010-12-15 20:02:53 +0100 |
---|---|---|
committer | Kitty Barnett <develop@catznip.com> | 2010-12-15 20:02:53 +0100 |
commit | b854cde9a012b83dd6eaeddea6a1e60b17435534 (patch) | |
tree | c4537cf3ebfdd3cd712178106dd359367d0e09bb /indra/newview | |
parent | 0f1d337a1e20d2d0f2b16e5df7e94c64a95ca6f0 (diff) |
STORM-800 FIXED Crash in LLRemoteParcelInfoProcessor::processParcelInfoReply()
Diffstat (limited to 'indra/newview')
-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); } } |