mirror of
https://github.com/cookiengineer/audacity
synced 2026-04-24 23:13:42 +02:00
Bug 2060: Windows: no access to microphone causes crash
Problem: 1. Set no access to microphone in Privacy category of Settings app. 2. Try to record in a new track. (not append to an existing track.) 3. Audacity crashes. Cause of crash: TrackPanel::OnTrackListResizing is called with a track after a call to TrackList::ClearPendingTracks, which has removed its owner. TrackPanel::OnTrackListResizing ends up calling TrackPanel::UpdateTrackVRuler, and this function calls TrackList::Channels(t)), which assumes the track has an owner. Crash. Fix: in TrackPanel::OnTrackListResizing, check that the track has an owner.
This commit is contained in:
@@ -329,6 +329,8 @@ public:
|
|||||||
// For use when loading a file. Return true if ok, else make repair
|
// For use when loading a file. Return true if ok, else make repair
|
||||||
bool LinkConsistencyCheck();
|
bool LinkConsistencyCheck();
|
||||||
|
|
||||||
|
bool HasOwner() const { return static_cast<bool>(GetOwner());}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<TrackList> GetOwner() const { return mList.lock(); }
|
std::shared_ptr<TrackList> GetOwner() const { return mList.lock(); }
|
||||||
|
|
||||||
|
|||||||
@@ -715,7 +715,8 @@ void TrackPanel::OnTrackListResizing(TrackListEvent & e)
|
|||||||
{
|
{
|
||||||
auto t = e.mpTrack.lock();
|
auto t = e.mpTrack.lock();
|
||||||
// A deleted track can trigger the event. In which case do nothing here.
|
// A deleted track can trigger the event. In which case do nothing here.
|
||||||
if( t )
|
// A deleted track can have a valid pointer but no owner, bug 2060
|
||||||
|
if( t && t->HasOwner() )
|
||||||
UpdateVRuler(t.get());
|
UpdateVRuler(t.get());
|
||||||
e.Skip();
|
e.Skip();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user