VirtualBox

Changeset 39502 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 1, 2011 9:25:15 PM (13 years ago)
Author:
vboxsync
Message:

RTReqQueueDestroy: Don't forget to destroy the requests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/reqqueue.cpp

    r39500 r39502  
    11/* $Id$ */
    22/** @file
    3  * IPRT - Request packets
     3 * IPRT - Request Queue.
    44 */
    55
     
    7979    RTSemEventDestroy(pQueue->EventSem);
    8080    pQueue->EventSem = NIL_RTSEMEVENT;
     81
     82    for (unsigned i = 0; i < RT_ELEMENTS(pQueue->apReqFree); i++)
     83    {
     84        PRTREQ pReq = (PRTREQ)ASMAtomicXchgPtr(&pQueue->apReqFree[i], NULL);
     85        while (pReq)
     86        {
     87            PRTREQ pNext = pReq->pNext;
     88
     89            pReq->u32Magic = RTREQ_MAGIC_DEAD;
     90            RTSemEventDestroy(pReq->EventSem);
     91            pReq->EventSem = NIL_RTSEMEVENT;
     92            RTMemFree(pReq);
     93
     94            pReq = pNext;
     95        }
     96    }
     97
    8198    RTMemFree(pQueue);
    8299    return VINF_SUCCESS;
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