On 3 February 2011 19:56, Julie S <[email protected]> wrote:
> I've traced this to the the call in Segment::findSingle(Event *e)
>
> std::pair<iterator, iterator> interval = equal_range(e);
>
> this STL command is breaking and breaking because our Event::operator<(const 
> Event &a, const Event &b) is accessing the reference to a pointer we already 
> deleted.

Ah, you're quite right.

A better idea then must be to take advantage of the fact that
Selection removes any events that have been deleted, instead of trying
to ignore it.  We can't test whether an event has been deleted by
checking whether it's still in the selection, because
EventSelection::contains() will fail for the same reason.

What we could do is traverse the selection repeatedly from the start.
We maintain a separate set of all the events which we have already
requested to be collapsed, initially empty; and as we traverse the
selection, we test each event to see whether it's in this set (we can
do this just by comparing pointers, so it's safe).  If our event is in
this set, we skip it; otherwise we ask to collapse it, add it to the
set, and start traversing the selection from the beginning again (to
ensure no new events are missed).

I'll commit a bit of code that does that.


Chris

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to