- Timestamp:
- Aug 27, 2018 12:49:05 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r73897 r73901 863 863 ++itSkipped; 864 864 } 865 865 866 866 skipped = vsdescThis->i_findByType(VirtualSystemDescriptionType_HardDiskImage); 867 867 itSkipped = skipped.begin(); … … 912 912 HRESULT rc; 913 913 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 */ 915 923 { 916 924 rc = i_setUpProgress(aProgress, 917 925 BstrFmt(tr("Export appliance '%s'"), aLocInfo.strPath.c_str()), 918 926 (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 920 930 /* Initialize our worker task */ 921 931 TaskOPC* task = NULL; … … 926 936 catch(...) 927 937 { 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 */ 928 946 delete task; 929 947 throw rc = setError(VBOX_E_OBJECT_NOT_FOUND,
Note:
See TracChangeset
for help on using the changeset viewer.