VirtualBox

Ignore:
Timestamp:
Nov 4, 2015 5:15:34 PM (9 years ago)
Author:
vboxsync
Message:

Audio/AudioMixer.cpp: Try to fix a crash (for bugref:8054).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/AudioMixer.cpp

    r56692 r58573  
    349349        return;
    350350
    351     PAUDMIXSTREAM pStream = RTListGetFirst(&pSink->lstStreams, AUDMIXSTREAM, Node);
    352     while (pStream)
    353     {
    354         PAUDMIXSTREAM pNext = RTListNodeGetNext(&pStream->Node, AUDMIXSTREAM, Node);
    355         bool fLast = RTListNodeIsLast(&pSink->lstStreams, &pStream->Node);
    356 
     351    PAUDMIXSTREAM pStream, pStreamNext;
     352    RTListForEachSafe(&pSink->lstStreams, pStream, pStreamNext, AUDMIXSTREAM, Node)
    357353        AudioMixerRemoveStream(pSink, pStream);
    358 
    359         if (fLast)
    360             break;
    361 
    362         pStream = pNext;
    363     }
    364354
    365355    Assert(pSink->cStreams == 0);
     
    385375    pSink->cStreams--;
    386376
     377#ifdef DEBUG
    387378    const char *pszStream = pSink->enmDir == AUDMIXSINKDIR_INPUT
    388379                          ? pStream->pIn->MixBuf.pszName : pStream->pOut->MixBuf.pszName;
    389380
    390381    LogFlowFunc(("%s: pStream=%s, cStreams=%RU8\n",
    391                  pSink->pszName, pszStream, pSink->cStreams));
     382                 pSink->pszName, pszStream ? pszStream : "<Unnamed>", pSink->cStreams));
     383#endif
    392384
    393385    audioMixerDestroyStream(pStream);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette