From 7024232855d268633760674d34c096ce447b7240 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 20 Feb 2015 14:11:46 -0500 Subject: [PATCH] ensure that stub audio file sources are removed when we destroy a track --- libs/ardour/audio_diskstream.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index cf3f550ac4..2d4d02f830 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -2445,6 +2445,24 @@ AudioDiskstream::ChannelInfo::resize_capture (framecnt_t capture_bufsize) AudioDiskstream::ChannelInfo::~ChannelInfo () { + if (write_source) { + if (write_source->removable()) { + /* this is a "stub" write source which exists in the + Session source list, but is removable. We must emit + a drop references call because it should not + continue to exist. If we do not do this, then the + Session retains a reference to it, it is not + deleted, and later attempts to create a new source + file will use wierd naming because it already + exists. + + XXX longer term TO-DO: do not add to session source + list until we write to the source. + */ + write_source->drop_references (); + } + } + write_source.reset (); delete [] speed_buffer;