VirtualBox

Changeset 107256 in vbox


Ignore:
Timestamp:
Dec 9, 2024 1:15:31 PM (6 weeks ago)
Author:
vboxsync
Message:

bugref:10806. Updated TrackedObjectsCollector::getObj(). jiraref:VBP-1459.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/ObjectsTracker.cpp

    r107255 r107256  
    428428
    429429    IterTrObjData_T pIter = m_trackedObjectsData.find(aObjId);
    430     if (pIter != m_trackedObjectsData.end() && fUpdate == true)
    431     {
    432         /* Update some fields in the found object if needed. in instance, the last access time */
    433         com::Utf8Str lat = pIter->second.updateLastAccessTime(); /* Update the access time */
    434         Log2(("The updated last access time is %s\n", lat.c_str()));
     430    if (pIter != m_trackedObjectsData.end())
     431    {
     432        if (fUpdate == true)
     433        {
     434            /* Update some fields in the found object if needed. in instance, the last access time */
     435            com::Utf8Str lat = pIter->second.updateLastAccessTime(); /* Update the access time */
     436            Log2(("The updated last access time is %s\n", lat.c_str()));
     437        }
    435438        hrc = S_OK;
    436439    }
     440    else
     441        hrc = VBOX_E_OBJECT_NOT_FOUND;
    437442
    438443    if (SUCCEEDED(hrc))
    439     {
    440         /** @todo r=bird: Why do three lookups? */
    441         if ( i_getObj(aObjId).getInterface().isNotNull() )
    442         {
    443             if (i_getObj(aObjId).state() != TrackedObjectState_Invalid)
    444             {
    445                 aObjData = i_getObj(aObjId);
    446                 hrc = S_OK;
    447             }
    448             else
    449                 hrc = VBOX_E_INVALID_OBJECT_STATE;
    450         }
    451         else
    452             hrc = VBOX_E_OBJECT_NOT_FOUND;
    453     }
     444        aObjData = i_getObj(aObjId);
    454445
    455446    /* Leave critical section here */
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