app: fix issue trying to erase "end" element of vector

This commit is contained in:
itsmattkc 2022-08-06 21:04:53 -07:00
parent 74683de19a
commit 80ea063c55

View file

@ -507,7 +507,11 @@ void MediaPanel::AudioOutputEnded()
{
auto out = static_cast<QAudioOutput*>(sender());
m_audioOutputs.erase(std::find(m_audioOutputs.begin(), m_audioOutputs.end(), out));
auto it = std::find(m_audioOutputs.begin(), m_audioOutputs.end(), out);
if (it != m_audioOutputs.end()) {
m_audioOutputs.erase(it);
}
delete out;
}