VirtualBox

Ignore:
Timestamp:
Mar 3, 2009 9:16:15 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
43608
Message:

#3551: “Main: Replace remaining collections with safe arrays”
Replace SnapshotCollection. Reviewed by dmik. Tested with GUI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r17078 r17260  
    6666
    6767    /* get the children */
    68     ComPtr<ISnapshotCollection> coll;
    69     rootSnapshot->COMGETTER(Children)(coll.asOutParam());
    70     if (coll)
    71     {
    72         ComPtr<ISnapshotEnumerator> enumerator;
    73         coll->Enumerate(enumerator.asOutParam());
    74         ULONG index = 0;
    75         BOOL hasMore = FALSE;
    76         while (enumerator->HasMore(&hasMore), hasMore)
    77         {
    78             ComPtr<ISnapshot> snapshot;
    79             enumerator->GetNext(snapshot.asOutParam());
     68    SafeIfaceArray <ISnapshot> coll;
     69    rootSnapshot->COMGETTER(Children)(ComSafeArrayAsOutParam(coll));
     70    if (!coll.isNull())
     71    {
     72        for (size_t index = 0; index < coll.size(); ++index)
     73        {
     74            ComPtr<ISnapshot> snapshot = coll[index];
    8075            if (snapshot)
    8176            {
     
    8883                showSnapshots(snapshot, details, newPrefix, level + 1);
    8984            }
    90             index++;
    9185        }
    9286    }
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