VirtualBox

Changeset 33292 in vbox


Ignore:
Timestamp:
Oct 21, 2010 10:33:12 AM (14 years ago)
Author:
vboxsync
Message:

VBoxService/Guest Execution: Destroy local stdin pipe buffer when process is dead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp

    r33283 r33292  
    4747extern RTLISTNODE g_GuestControlExecThreads;
    4848
     49void VBoxServiceControlExecDeletePipeBuffer(PVBOXSERVICECTRLEXECPIPEBUF pBuf);
     50
    4951
    5052/**
     
    544546    if (RT_SUCCESS(rc))
    545547    {
    546         /** WRONG CONTEXT ID!!!! */
    547 #if 0
    548         rc = VbglR3GuestCtrlExecReportStatusIn(pThread->uClientID, pThread->uContextID, pData->uPID,
    549                                                INPUT_STS_TERMINATED, 0 /* Flags */, 0);
    550 
    551         rc = VbglR3GuestCtrlExecSendOut(pThread->uClientID, pThread->uContextID, pData->uPID,
    552                                         0 /* Handle ID */, 0 /* Flags */, NULL, 0);
    553 #endif
     548        /* Since the process is not alive anymore, destroy its local
     549         * stdin pipe buffer - it's not used anymore and can eat up quite
     550         * a bit of memory. */
     551        VBoxServiceControlExecDeletePipeBuffer(&pData->stdIn);
    554552
    555553        uint32_t uStatus = PROC_STS_UNDEFINED;
     
    712710{
    713711    AssertPtr(pBuf);
    714     RTMemFree(pBuf->pbData);
    715     pBuf->pbData = NULL;
    716     pBuf->cbAllocated = 0;
    717     pBuf->cbSize = 0;
    718     pBuf->cbOffset = 0;
    719     pBuf->fAlive = false;
     712    if (pBuf->pbData)
     713    {
     714        RTMemFree(pBuf->pbData);
     715        pBuf->pbData = NULL;
     716        pBuf->cbAllocated = 0;
     717        pBuf->cbSize = 0;
     718        pBuf->cbOffset = 0;
     719        pBuf->fAlive = false;
     720    }
    720721
    721722    RTPipeClose(pBuf->hNotificationPipeR);
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