VirtualBox

Changeset 27718 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Mar 25, 2010 5:23:59 PM (15 years ago)
Author:
vboxsync
Message:

DrvIntNet: fixed destructor if constructor failed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r26574 r27718  
    753753    pThis->hSgCache = NIL_RTMEMCACHE;
    754754
    755     /*
    756      * Deregister statistics in case we're being detached.
    757      */
    758     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Recv.cStatFrames);
    759     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Recv.cbStatWritten);
    760     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Recv.cOverflows);
    761     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Send.cStatFrames);
    762     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Send.cbStatWritten);
    763     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Send.cOverflows);
    764     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->cStatYieldsOk);
    765     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->cStatYieldsNok);
    766     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->cStatLost);
    767     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->cStatBadFrames);
     755    if (pThis->pBufR3)
     756    {
     757        /*
     758         * Deregister statistics in case we're being detached.
     759         */
     760        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Recv.cStatFrames);
     761        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Recv.cbStatWritten);
     762        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Recv.cOverflows);
     763        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Send.cStatFrames);
     764        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Send.cbStatWritten);
     765        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->Send.cOverflows);
     766        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->cStatYieldsOk);
     767        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->cStatYieldsNok);
     768        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->cStatLost);
     769        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->pBufR3->cStatBadFrames);
    768770#ifdef VBOX_WITH_STATISTICS
    769     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatReceive);
    770     PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatTransmit);
     771        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatReceive);
     772        PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->StatTransmit);
    771773#endif
     774    }
    772775}
    773776
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