# HG changeset patch # User Chris Cannam # Date 1456996348 0 # Node ID b926f08909b845da546366c2b8b463a92703c7f6 # Parent 51befd6165a3e958baa2657ca30fa1d54198c28f Fix crashes in play() and stop() if no record target / play source present diff -r 51befd6165a3 -r b926f08909b8 framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Wed Mar 02 17:25:27 2016 +0000 +++ b/framework/MainWindowBase.cpp Thu Mar 03 09:12:28 2016 +0000 @@ -2706,7 +2706,8 @@ void MainWindowBase::play() { - if (m_recordTarget->isRecording() || m_playSource->isPlaying()) { + if ((m_recordTarget && m_recordTarget->isRecording()) || + (m_playSource && m_playSource->isPlaying())) { stop(); QAction *action = qobject_cast(sender()); if (action) action->setChecked(false); @@ -3085,10 +3086,13 @@ void MainWindowBase::stop() { - if (m_recordTarget->isRecording()) { + if (m_recordTarget && + m_recordTarget->isRecording()) { m_recordTarget->stopRecording(); } - + + if (!m_playSource) return; + m_playSource->stop(); if (m_audioIO) m_audioIO->suspend();