1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-29 16:08:46 +01: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:
David Bailes
2019-02-05 14:29:22 +00:00
parent 807a763c90
commit 012d707a8a
2 changed files with 4 additions and 1 deletions

View File

@@ -329,6 +329,8 @@ public:
// For use when loading a file. Return true if ok, else make repair
bool LinkConsistencyCheck();
bool HasOwner() const { return static_cast<bool>(GetOwner());}
private:
std::shared_ptr<TrackList> GetOwner() const { return mList.lock(); }