[opensource-dev] Review Request: Crash in LLRemoteParcelInfoProcessor::processParcelInfoReply()

Kitty Barnett sldev at catznip.com
Thu Dec 16 11:06:45 PST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://codereview.secondlife.com/r/24/
-----------------------------------------------------------

(Updated 2010-12-16 11:06:44.936367)


Review request for Viewer.


Changes
-------

Added comments.

I'm wondering if there is still a reason for the deadlist_t related code now?

If that was "inlined" into the loop it would become:

	while (oi != end)
	{
		// 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 (invalidates cur_oi)
			observers.erase(cur_oi);
		}
	}

That might decrease the chance of the fix being reverted since even if the comment on "processParcelInfo" is missed, then "observers.erase()" would still make the need for two iterators ("oi" and "cur_oi") clear?


Summary
-------

erase() on a multimap will only invalidate iterators that point to the element being erased so pre-incrementing the loop iterator should prevent it from getting invalidated when an observer calls removeObserver() as part of its processParcelInfo() implementation.


This addresses bug VWR-24207.
    http://jira.secondlife.com/browse/VWR-24207


Diffs (updated)
-----

  indra/newview/llremoteparcelrequest.cpp UNKNOWN 

Diff: http://codereview.secondlife.com/r/24/diff


Testing
-------


Thanks,

Kitty

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20101216/948e66f9/attachment-0001.htm 


More information about the opensource-dev mailing list