Add an assert and fix a crash on creating a new tape track.
authorCarl Hetherington <carl@carlh.net>
Mon, 22 Mar 2010 22:14:54 +0000 (22:14 +0000)
committerCarl Hetherington <carl@carlh.net>
Mon, 22 Mar 2010 22:14:54 +0000 (22:14 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6785 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/audio_diskstream.cc

index 1f77964d0d63565c11b2cea81bc4df07b210a969..03f17c6e760b435a919a6d162d8854b990aa8a56 100644 (file)
@@ -346,6 +346,8 @@ AudioDiskstream::setup_destructive_playlist ()
 
        /* a single full-sized region */
 
+       assert (!srcs.empty ());
+
        PropertyList plist;
        plist.add (Properties::name, _name.val());
        plist.add (Properties::start, 0);
@@ -1968,7 +1970,7 @@ AudioDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)
                }
        }
 
-       if (destructive()) {
+       if (destructive() && !c->empty ()) {
 
                /* we now have all our write sources set up, so create the
                   playlist's single region.