VirtualBox

Changeset 64349 in vbox for trunk/src


Ignore:
Timestamp:
Oct 21, 2016 10:05:29 AM (8 years ago)
Author:
vboxsync
Message:

Audio/DevIchAc97.cpp: Fixed crashes on destruction.

File:
1 edited

Legend:

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

    r64333 r64349  
    743743    LogFlowFuncEnter();
    744744
    745     PAUDMIXSINK pSink;
    746745    switch (enmRecSource)
    747746    {
    748747        case PDMAUDIORECSOURCE_MIC:
    749             pSink = pThis->pSinkMicIn;
    750             break;
     748            AudioMixerSinkDestroy(pThis->pSinkMicIn);
     749            pThis->pSinkMicIn = NULL;
     750            break;
     751
    751752        case PDMAUDIORECSOURCE_LINE:
    752             pSink = pThis->pSinkLineIn;
    753             break;
     753            AudioMixerSinkDestroy(pThis->pSinkLineIn);
     754            pThis->pSinkLineIn = NULL;
     755            break;
     756
    754757        default:
    755758            AssertMsgFailed(("Audio source %ld not supported\n", enmRecSource));
     
    766769            pStream = &pDrv->LineIn;
    767770
    768         if (pStream->pMixStrm)
    769         {
    770             AudioMixerSinkRemoveStream(pSink, pStream->pMixStrm);
    771             AudioMixerStreamDestroy(pStream->pMixStrm);
    772         }
    773771        pStream->pMixStrm = NULL;
    774772    }
     
    780778
    781779    LogFlowFuncEnter();
     780
     781    AudioMixerSinkDestroy(pThis->pSinkOut);
     782    pThis->pSinkOut = NULL;
    782783
    783784    PAC97DRIVER pDrv;
    784785    RTListForEach(&pThis->lstDrv, pDrv, AC97DRIVER, Node)
    785786    {
    786         if (pDrv->Out.pMixStrm)
    787         {
    788             AudioMixerSinkRemoveStream(pThis->pSinkOut, pDrv->Out.pMixStrm);
    789             AudioMixerStreamDestroy(pDrv->Out.pMixStrm);
    790 
    791             pDrv->Out.pMixStrm = NULL;
    792         }
     787        pDrv->Out.pMixStrm = NULL;
    793788    }
    794789}
     
    24802475    LogRel2(("AC97: Powering off ...\n"));
    24812476
     2477    /* Note: Involves mixer stream / sink destruction, so also do this here
     2478     *       instead of in ichac97Destruct(). */
     2479    ichac97StreamsDestroy(pThis);
     2480
    24822481    /**
    24832482     * Note: Destroy the mixer while powering off and *not* in ichac97Destruct,
     
    25382537
    25392538    LogFlowFuncEnter();
    2540 
    2541     ichac97StreamsDestroy(pThis);
    25422539
    25432540    PAC97DRIVER pDrv, pDrvNext;
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