VirtualBox

Changeset 73901 in vbox for trunk


Ignore:
Timestamp:
Aug 27, 2018 12:49:05 AM (6 years ago)
Author:
vboxsync
Message:

ApplianceImplExport.cpp: Fixed scm; added three r=bird todos in related code. bugref:9152

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp

    r73897 r73901  
    863863                ++itSkipped;
    864864            }
    865  
     865
    866866            skipped = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskImage);
    867867            itSkipped = skipped.begin();
     
    912912    HRESULT rc;
    913913    RT_NOREF(aFormat);
    914     try
     914    try /** @todo r=bird: This try..catch(HRESULT) stuff here totally messes up anyones
     915         * understanding of what i_setUpProgress and createThread() might throw.  You really
     916         * think that they must throw some 'HRESULT' stuff too, right. Otherwise, why would
     917         * anyone put their invocations inside these try..catch statements?  But the, WTF
     918         * do they return status codes?  ARRRRRRRRRRRRRRG!
     919         *
     920         * Please rewrite this and all similar places to use nested if (SUCCEEDED(hrc)) rather
     921         * than unmaintainable code like this.
     922         */
    915923    {
    916924        rc = i_setUpProgress(aProgress,
    917925                             BstrFmt(tr("Export appliance '%s'"), aLocInfo.strPath.c_str()),
    918926                             (aLocInfo.storageType == VFSType_File) ? WriteFile : WriteS3);
    919  
     927/** @todo r=bird: You ignore the status code here... You can simply return if this fails, because
     928 * you don't have any state to clean up. */
     929
    920930        /* Initialize our worker task */
    921931        TaskOPC* task = NULL;
     
    926936        catch(...)
    927937        {
     938/** @todo r=bird: Task will always be NULL here.  Why? Because the assignment of 'task' is
     939 * the very last thing that happens above.  Traditionally, when you 'delete (TaskOPC *)NULL'
     940 * the CRT kills your process.  (On windows, though, this may differ depending on whether we're
     941 * executing this in a COM worker thread or a IPRT/main worker thread.  We may survive in the
     942 * former, but not the latter.)
     943 *
     944 * P.S. Please make your editor strip trailing spaces on lines you've modified.
     945 */
    928946            delete task;
    929947            throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
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