1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-02 17:23:18 +02:00

Bug834, part 2 - Memory leak and orphans after cancelling any generator

New project.  New track.  Generate sound -- do not cancel.  Select all,
generate sound again -- this time, do cancel the progress dialog.

Undo, so you see one, empty track again.  Save.  Close.  Reopen.

The cause of these orphans is different from the first case.  The previous
commit is necessary but not sufficient to fix this.
This commit is contained in:
Paul-Licameli 2015-04-08 11:33:46 -04:00
parent a562f2c922
commit 14a36dad46
3 changed files with 8 additions and 4 deletions

View File

@ -700,8 +700,9 @@ Track *SyncLockedTracksIterator::Last(bool skiplinked)
DEFINE_EVENT_TYPE(EVT_TRACKLIST_RESIZED);
DEFINE_EVENT_TYPE(EVT_TRACKLIST_UPDATED);
TrackList::TrackList()
TrackList::TrackList(bool destructorDeletesTracks)
: wxEvtHandler()
, mDestructorDeletesTracks(destructorDeletesTracks)
{
head = NULL;
tail = NULL;
@ -709,7 +710,7 @@ TrackList::TrackList()
TrackList::~TrackList()
{
Clear();
Clear(mDestructorDeletesTracks);
}
void TrackList::RecalcPositions(const TrackListNode *node)

View File

@ -348,7 +348,7 @@ class AUDACITY_DLL_API TrackList:public wxEvtHandler
{
public:
// Create an empty TrackList
TrackList();
TrackList(bool destructorDeletesTracks = false);
// Destructor
virtual ~TrackList();
@ -437,6 +437,8 @@ class AUDACITY_DLL_API TrackList:public wxEvtHandler
TrackListNode *head;
TrackListNode *tail;
bool mDestructorDeletesTracks;
};
class AUDACITY_DLL_API TrackFactory

View File

@ -113,6 +113,7 @@ Effect::Effect()
Effect::~Effect()
{
delete mOutputTracks;
if (mWarper != NULL)
{
delete mWarper;
@ -1364,7 +1365,7 @@ void Effect::CopyInputTracks(int trackType)
mIMap.Clear();
mOMap.Clear();
mOutputTracks = new TrackList();
mOutputTracks = new TrackList(true);
mOutputTracksType = trackType;
//iterate over tracks of type trackType (All types if Track::All)