VirtualBox

Changeset 31333 in vbox for trunk/src/VBox/Main/testcase


Ignore:
Timestamp:
Aug 3, 2010 1:00:54 PM (14 years ago)
Author:
vboxsync
Message:

Main: rework new implementation of Machine::Unregister() and Machine::Delete() to be more flexible and still easy to use

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/tstOVF.cpp

    r30956 r31333  
    349349
    350350            RTPrintf("  Deleting machine %ls...\n", bstrUUID.raw());
    351             SafeArray<BSTR> sfaFiles;
    352             rc = pMachine->Unregister(true /* fDetachMedia */,
    353                                       ComSafeArrayAsOutParam(sfaFiles));
     351            SafeIfaceArray<IMedium> sfaMedia;
     352            rc = pMachine->Unregister(CleanupMode_DetachAllReturnHardDisksOnly,
     353                                      ComSafeArrayAsOutParam(sfaMedia));
    354354            if (FAILED(rc)) throw MyError(rc, "Machine::Unregister() failed\n");
    355355
    356             for (size_t u = 0;
    357                  u < sfaFiles.size();
    358                  ++u)
    359             {
    360                 RTPrintf("    UnregisterMachine reported disk image %ls\n", sfaFiles[u]);
    361                 llFiles2Delete.push_back(sfaFiles[u]);
    362             }
    363 
    364             rc = pMachine->Delete();
     356            ComPtr<IProgress> pProgress;
     357            rc = pMachine->Delete(ComSafeArrayAsInParam(sfaMedia), pProgress.asOutParam());
    365358            if (FAILED(rc)) throw MyError(rc, "Machine::DeleteSettings() failed\n");
     359            rc = pProgress->WaitForCompletion(-1);
     360            if (FAILED(rc)) throw MyError(rc, "Progress::WaitForCompletion() failed\n");
    366361        }
    367362    }
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