VirtualBox

Changeset 28132 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
Apr 9, 2010 10:02:00 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59855
Message:

Guest Control: Update (fixed leak in host service, --wait option for VBoxManage).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/GuestControl/service.cpp

    r28087 r28132  
    453453                 rc = execBufferAssign(&curCmd.parmBuf, cParms, paParms);
    454454                 if (RT_SUCCESS(rc))
     455                 {
     456                     execBufferFree(&curCmd.parmBuf);
    455457                     mHostCmds.pop_front();
     458                 }
    456459             }
    457460        }
     
    487490    int rc = VINF_SUCCESS;
    488491
    489     HostCmd newCmd;
    490     execBufferAllocate(&newCmd.parmBuf, cParms, paParms);
    491     mHostCmds.push_back(newCmd);
    492 
    493     /* Limit list size by deleting oldest element. */
    494     if (mHostCmds.size() > 256) /** @todo Use a define! */
    495         mHostCmds.pop_front();
    496 
    497492    /* Some lazy guests to wake up? */
    498493    if (!mGuestWaiters.empty())
     
    501496        rc = hostNotifyGuest(&curCall, eFunction, cParms, paParms);
    502497        mGuestWaiters.pop_front();
     498    }
     499    else /* No guests waiting, buffer it */
     500    {
     501        HostCmd newCmd;
     502        rc = execBufferAllocate(&newCmd.parmBuf, cParms, paParms);
     503        if (RT_SUCCESS(rc))
     504        {
     505            mHostCmds.push_back(newCmd);
     506       
     507            /* Limit list size by deleting oldest element. */
     508            if (mHostCmds.size() > 256) /** @todo Use a define! */
     509                mHostCmds.pop_front();
     510        }
    503511    }
    504512    return rc;
Note: See TracChangeset for help on using the changeset viewer.

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