Hopefully fix segfault.

git-svn-id: svn://localhost/ardour2/branches/3.0@6481 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-01-12 23:50:57 +00:00
parent 4e4c75a34a
commit 92fbcd021d
2 changed files with 11 additions and 7 deletions

View File

@ -774,13 +774,15 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
boost::shared_ptr<Playlist> pl = t->diskstream()->playlist ();
if (pl) {
boost::shared_ptr<Region> r = pl->top_region_at (unit_to_frame (event->button.x));
RegionView* rv = rtv->view()->find_view (r);
clicked_selection = select_range_around_region (rv);
_drags->add (new SelectionDrag (this, item, SelectionDrag::SelectionMove));
list<RegionView*> rvs;
rvs.push_back (rv);
_drags->add (new RegionMoveDrag (this, item, rv, rvs, false, false));
_drags->start_grab (event);
if (r) {
RegionView* rv = rtv->view()->find_view (r);
clicked_selection = select_range_around_region (rv);
_drags->add (new SelectionDrag (this, item, SelectionDrag::SelectionMove));
list<RegionView*> rvs;
rvs.push_back (rv);
_drags->add (new RegionMoveDrag (this, item, rv, rvs, false, false));
_drags->start_grab (event);
}
}
}
}

View File

@ -1421,6 +1421,8 @@ Editor::deselect_all ()
long
Editor::select_range_around_region (RegionView* rv)
{
assert (rv);
selection->set (&rv->get_time_axis_view());
selection->time.clear ();