Guard against crash when stopping a stream...

... caused by remembering a NULL pointer to active project when starting a
stream.

Hard to reproduce, but reported by David Bailes.  We suspect that both the
closing of another project window, and changes of focused application, are
necessary to reproduce the problem.
This commit is contained in:
Paul Licameli 2017-10-17 06:17:06 -04:00
parent b49e467412
commit 9694279804
1 changed files with 6 additions and 0 deletions

View File

@ -1643,6 +1643,12 @@ bool AudioIO::StartPortAudioStream(double sampleRate,
mAudioFramesPerBuffer = 0;
#endif
mOwningProject = GetActiveProject();
// PRL: Protection from crash reported by David Bailes, involving starting
// and stopping with frequent changes of active window, hard to reproduce
if (!mOwningProject)
return false;
mInputMeter = NULL;
mOutputMeter = NULL;