VirtualBox

Changeset 32641 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Sep 20, 2010 2:01:17 PM (14 years ago)
Author:
vboxsync
Message:

Storage/VBoxHDD: small optimization in the error path, no need to close images which were never opened.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VBoxHDD.cpp

    r32604 r32641  
    45114511        else
    45124512        {
    4513             /* Error detected, but image opened. Close and delete image. */
    4514             rc2 = pImage->Backend->pfnClose(pImage->pBackendData, true);
    4515             AssertRC(rc2);
    4516             pImage->pBackendData = NULL;
     4513            /* Error detected, image may or may not be opened. Close and delete
     4514             * image if it was opened. */
     4515            if (pImage->pBackendData)
     4516            {
     4517                rc2 = pImage->Backend->pfnClose(pImage->pBackendData, true);
     4518                AssertRC(rc2);
     4519                pImage->pBackendData = NULL;
     4520            }
    45174521        }
    45184522    } while (0);
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