Skip to content
Snippets Groups Projects
Commit b854cde9 authored by Kitty Barnett's avatar Kitty Barnett
Browse files

STORM-800 FIXED Crash in LLRemoteParcelInfoProcessor::processParcelInfoReply()

parent 0f1d337a
No related branches found
No related tags found
No related merge requests found
...@@ -140,22 +140,25 @@ void LLRemoteParcelInfoProcessor::processParcelInfoReply(LLMessageSystem* msg, v ...@@ -140,22 +140,25 @@ void LLRemoteParcelInfoProcessor::processParcelInfoReply(LLMessageSystem* msg, v
typedef std::vector<observer_multimap_t::iterator> deadlist_t; typedef std::vector<observer_multimap_t::iterator> deadlist_t;
deadlist_t dead_iters; deadlist_t dead_iters;
observer_multimap_t::iterator oi; observer_multimap_t::iterator oi = observers.lower_bound(parcel_data.parcel_id);
observer_multimap_t::iterator start = observers.lower_bound(parcel_data.parcel_id);
observer_multimap_t::iterator end = observers.upper_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) if(observer)
{ {
// may invalidate cur_oi if the observer removes itself
observer->processParcelInfo(parcel_data); observer->processParcelInfo(parcel_data);
} }
else else
{ {
// the handle points to an expired observer, so don't keep it // the handle points to an expired observer, so don't keep it
// around anymore // around anymore
dead_iters.push_back(oi); dead_iters.push_back(cur_oi);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment