VirtualBox

Ignore:
Timestamp:
Apr 11, 2008 7:40:42 AM (17 years ago)
Author:
vboxsync
Message:

VDI: Skip flushing the image if the open wasn't successful.

File:
1 edited

Legend:

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

    r7780 r7894  
    688688    Assert(VALID_PTR(pImage));
    689689
    690     vdiFlushImage(pImage);
    691690    if (pImage->File != NIL_RTFILE)
    692691    {
     692        vdiFlushImage(pImage);
    693693        RTFileClose(pImage->File);
    694694        pImage->File = NIL_RTFILE;
     
    725725    }
    726726    pImage->pszFilename = pszFilename;
     727    pImage->File = NIL_RTFILE;
     728    pImage->paBlocks = NULL;
     729    pImage->pfnError = NULL;
     730    pImage->pvErrorUser = NULL;
    727731
    728732    rc = vdiOpenImage(pImage, VD_OPEN_FLAGS_INFO | VD_OPEN_FLAGS_READONLY);
     
    765769    }
    766770    pImage->pszFilename = pszFilename;
     771    pImage->File = NIL_RTFILE;
    767772    pImage->paBlocks = NULL;
    768773    pImage->pfnError = pfnError;
     
    819824    }
    820825    pImage->pszFilename = pszFilename;
     826    pImage->File = NIL_RTFILE;
    821827    pImage->paBlocks = NULL;
    822828    pImage->pfnError = pfnError;
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