From 3254468526441d82134d49fd8c01305c4c362851 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 15 Sep 2010 14:37:08 +0000 Subject: fix crash caused when deleting a region without a playlist PLUS make it impossible to select a region without a playlist (i.e. part of an unfinished capture pass). fixes #1502 git-svn-id: svn://localhost/ardour2/branches/3.0@7779 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_ops.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gtk2_ardour/editor_ops.cc') diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index eac9068507..159df414a9 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -4144,7 +4144,10 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) boost::shared_ptr pl = (*x)->region()->playlist(); if (!pl) { - /* impossible, but this handles it for the future */ + /* region not yet associated with a playlist (e.g. unfinished + capture pass. + */ + ++x; continue; } @@ -4203,8 +4206,10 @@ Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) /* the pmap is in the same order as the tracks in which selected regions occured */ for (vector::iterator i = pmap.begin(); i != pmap.end(); ++i) { - (*i).pl->thaw(); - foo.push_back ((*i).pl); + if ((*i).pl) { + (*i).pl->thaw(); + foo.push_back ((*i).pl); + } } if (!foo.empty()) { -- cgit v1.2.3