VirtualBox

Changeset 22732 in vbox


Ignore:
Timestamp:
Sep 3, 2009 9:59:50 AM (15 years ago)
Author:
vboxsync
Message:

HGCM: properly delete a client handle on the client disconnect. Should fix HGCMReset hang.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/hgcm/HGCM.cpp

    r21878 r22732  
    13591359            rc = hgcmMsgSend (hMsg);
    13601360        }
    1361     }
    1362 
    1363     if (RT_SUCCESS(rc))
    1364     {
    1365         /* Remove the client id from the array in any case. */
    1366         int i;
    1367 
    1368         for (i = 0; i < m_cClients; i++)
    1369         {
    1370             if (m_paClientIds[i] == u32ClientId)
    1371             {
    1372                 m_cClients--;
    1373 
    1374                 if (m_cClients > i)
    1375                 {
    1376                     memmove (&m_paClientIds[i], &m_paClientIds[i + 1], m_cClients - i);
    1377                 }
    1378 
    1379                 break;
     1361        else
     1362        {
     1363            LogRel(("[%s] hgcmMsgAlloc(%p, SVC_MSG_DISCONNECT) failed %Rrc\n",
     1364                    RT_VALID_PTR(m_pszSvcName)? m_pszSvcName: "", m_thread, rc));
     1365        }
     1366    }
     1367
     1368    /* Remove the client id from the array in any case, rc does not matter. */
     1369    int i;
     1370
     1371    for (i = 0; i < m_cClients; i++)
     1372    {
     1373        if (m_paClientIds[i] == u32ClientId)
     1374        {
     1375            m_cClients--;
     1376
     1377            if (m_cClients > i)
     1378            {
     1379                memmove (&m_paClientIds[i], &m_paClientIds[i + 1], m_cClients - i);
    13801380            }
    1381         }
    1382 
    1383         /* Delete the client handle. */
    1384         hgcmObjDeleteHandle (u32ClientId);
    1385 
    1386         /* The service must be released. */
    1387         ReleaseService ();
    1388     }
     1381
     1382            break;
     1383        }
     1384    }
     1385
     1386    /* Delete the client handle. */
     1387    hgcmObjDeleteHandle (u32ClientId);
     1388
     1389    /* The service must be released. */
     1390    ReleaseService ();
    13891391
    13901392    LogFlowFunc(("rc = %Rrc\n", rc));
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