VirtualBox

Ignore:
Timestamp:
Dec 2, 2018 4:32:27 PM (6 years ago)
Author:
vboxsync
Message:

GuestControl: Dropped the HostCommand reference counting and sharing ability since we only need it for the session closing request/message/command/wussname. This means we can use iprt/list.h and run no risk of bad_alloc during EnqueueCommand(). bugref:9313 [build fix]

File:
1 edited

Legend:

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

    r75872 r75873  
    8181#include <map>
    8282#include <new>      /* for std::nothrow*/
    83 #include <string>
    84 #include <list>
    8583
    8684
     
    435433    /** @} */
    436434} HostCommand;
    437 typedef std::list< HostCommand *> HostCmdList;
    438435
    439436/**
     
    10151012     * Cancel all pending host commands, replying with GUEST_DISCONNECTED if final recipient.
    10161013     */
    1017     HostCommand *pCur, *pNext;
    1018     RTListForEachSafeCpp(&pClient->m_HostCmdList, pCur, pNext, HostCommand, m_ListEntry)
    1019     {
    1020         RTListNodeRemove(&pCur->m_ListEntry);
     1014    HostCommand *pCurCmd, *pNextCmd;
     1015    RTListForEachSafeCpp(&pClient->m_HostCmdList, pCurCmd, pNextCmd, HostCommand, m_ListEntry)
     1016    {
     1017        RTListNodeRemove(&pCurCmd->m_ListEntry);
    10211018
    10221019        VBOXHGCMSVCPARM Parm;
    1023         HGCMSvcSetU32(&Parm, pCur->m_idContext);
     1020        HGCMSvcSetU32(&Parm, pCurCmd->m_idContext);
    10241021        int rc2 = pThis->hostCallback(GUEST_DISCONNECTED, 1, &Parm);
    10251022        LogFlowFunc(("Cancelled host command %u (%s) with idContext=%#x -> %Rrc\n",
    1026                      pCur->mMsgType, GstCtrlHostFnName((eHostFn)pCur->mMsgType), pCur->m_idContext, rc2));
     1023                     pCurCmd->mMsgType, GstCtrlHostFnName((eHostFn)pCurCmd->mMsgType), pCurCmd->m_idContext, rc2));
    10271024        RT_NOREF(rc2);
    10281025
    1029         pCur->Delete();
     1026        pCurCmd->Delete();
    10301027    }
    10311028
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