mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
BHug1488: Don't crash exiting from command-line benchmark test...
Problem was that cfd7648fce fixed a memory leak
but created a dangling pointer bug, which does not happen during usual run
of Audacity because AudacityProject::OnCloseWindow is reached then before
destroying AudacityProject.
Fixed it by using a std::shared_pointer for the TrackList that both
AudacityProject and TrackPanel must use.
This commit is contained in:
@@ -74,7 +74,7 @@ void TrackPanelAx::SetFocus( Track *track )
|
||||
|
||||
if( track == NULL )
|
||||
{
|
||||
TrackListIterator iter( mTrackPanel->mTracks );
|
||||
TrackListIterator iter( mTrackPanel->GetTracks() );
|
||||
track = iter.First();
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ bool TrackPanelAx::IsFocused( Track *track )
|
||||
|
||||
int TrackPanelAx::TrackNum( Track *target )
|
||||
{
|
||||
TrackListIterator iter( mTrackPanel->mTracks );
|
||||
TrackListIterator iter( mTrackPanel->GetTracks() );
|
||||
Track *t = iter.First();
|
||||
int ndx = 0;
|
||||
|
||||
@@ -142,7 +142,7 @@ int TrackPanelAx::TrackNum( Track *target )
|
||||
|
||||
Track *TrackPanelAx::FindTrack( int num )
|
||||
{
|
||||
TrackListIterator iter( mTrackPanel->mTracks );
|
||||
TrackListIterator iter( mTrackPanel->GetTracks() );
|
||||
Track *t = iter.First();
|
||||
int ndx = 0;
|
||||
|
||||
@@ -195,7 +195,7 @@ wxAccStatus TrackPanelAx::GetChild( int childId, wxAccessible** child )
|
||||
// Gets the number of children.
|
||||
wxAccStatus TrackPanelAx::GetChildCount( int* childCount )
|
||||
{
|
||||
TrackListIterator iter( mTrackPanel->mTracks );
|
||||
TrackListIterator iter( mTrackPanel->GetTracks() );
|
||||
Track *t = iter.First();
|
||||
int cnt = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user