summaryrefslogtreecommitdiff
path: root/gtk2_ardour/region_selection.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-09-15 14:37:08 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-09-15 14:37:08 +0000
commit3254468526441d82134d49fd8c01305c4c362851 (patch)
tree9c53f5af801a09a91fe4956a5867004f72ce62cc /gtk2_ardour/region_selection.cc
parent5e7ead224a036fc5ff9212cab615cd16f6f5aa84 (diff)
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
Diffstat (limited to 'gtk2_ardour/region_selection.cc')
-rw-r--r--gtk2_ardour/region_selection.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/gtk2_ardour/region_selection.cc b/gtk2_ardour/region_selection.cc
index 1a5a556514..c10888a086 100644
--- a/gtk2_ardour/region_selection.cc
+++ b/gtk2_ardour/region_selection.cc
@@ -98,11 +98,20 @@ bool RegionSelection::contains (RegionView* rv) const
/** Add a region to the selection.
* @param rv Region to add.
- * @return false if we already had the region, otherwise true.
+ * @return false if we already had the region or if it cannot be added,
+ * otherwise true.
*/
bool
RegionSelection::add (RegionView* rv)
{
+ if (!rv->region()->playlist()) {
+ /* not attached to a playlist - selection not allowed.
+ This happens if the user tries to select a region
+ during a capture pass.
+ */
+ return false;
+ }
+
if (contains (rv)) {
/* we already have it */
return false;