* fixed crash bug in MidiModel::const_iterator::operator=: copied iterator from other which becomes invalid because

the container the iterator points into is destroyed
* fixed conditional jump from uninitialised value in CanvasNote


git-svn-id: svn://localhost/ardour2/branches/3.0@3326 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Hans Baier 2008-05-06 22:54:06 +00:00
parent c415c44b9c
commit a42913736a
2 changed files with 11 additions and 10 deletions

View file

@ -31,15 +31,6 @@ namespace Canvas {
class CanvasNote : public SimpleRect, public CanvasNoteEvent {
public:
CanvasNote(
MidiRegionView& region,
Group& group,
const boost::shared_ptr<ARDOUR::Note> note = boost::shared_ptr<ARDOUR::Note>())
: SimpleRect(group), CanvasNoteEvent(region, this, note)
{
}
double x1() { return property_x1(); }
double y1() { return property_y1(); }
double x2() { return property_x2(); }
@ -61,6 +52,15 @@ public:
AbsoluteResize
};
CanvasNote(
MidiRegionView& region,
Group& group,
const boost::shared_ptr<ARDOUR::Note> note = boost::shared_ptr<ARDOUR::Note>())
: SimpleRect(group), CanvasNoteEvent(region, this, note), _note_state(None)
{
}
protected:
NoteState _note_state;

View file

@ -260,7 +260,8 @@ MidiModel::const_iterator& MidiModel::const_iterator::operator=(const const_iter
_locked = other._locked;
_note_iter = other._note_iter;
_control_iters = other._control_iters;
_control_iter = other._control_iter;
size_t index = other._control_iter - other._control_iters.begin();
_control_iter = _control_iters.begin() + index;
assert( ! _event.owns_buffer());