VirtualBox

Changeset 101052 in vbox


Ignore:
Timestamp:
Sep 7, 2023 1:11:24 PM (15 months ago)
Author:
vboxsync
Message:

Main: Check if data has been initialized in platform uninit(). bugref:10384

Location:
trunk/src/VBox/Main/src-server
Files:
3 edited

Legend:

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

    r101035 r101052  
    159159    unconst(mMachine) = NULL;
    160160
    161     m->bd.free();
    162     unconst(m->pPeer) = NULL;
    163 
    164     delete m;
    165     m = NULL;
     161    if (m)
     162    {
     163        m->bd.free();
     164        unconst(m->pPeer) = NULL;
     165
     166        delete m;
     167        m = NULL;
     168    }
    166169}
    167170
  • trunk/src/VBox/Main/src-server/PlatformImpl.cpp

    r101048 r101052  
    9191
    9292    m->bd.allocate();
     93
     94    /* Allocates architecture-dependent stuff. */
     95    HRESULT hrc = i_initArchitecture(m->bd->architectureType);
     96    AssertComRCReturnRC(hrc);
    9397
    9498    /* Confirm a successful initialization */
     
    662666 *          Usually only called when creating a new machine or loading settings.
    663667 */
    664 HRESULT Platform::i_initArchitecture(PlatformArchitecture_T aArchitecture, Platform *aThat, bool fCopy /* = false */)
     668HRESULT Platform::i_initArchitecture(PlatformArchitecture_T aArchitecture, Platform *aThat /* = NULL */, bool fCopy /* = false */)
    665669{
    666670    /* sanity */
  • trunk/src/VBox/Main/src-server/PlatformX86Impl.cpp

    r101035 r101052  
    168168    unconst(mMachine) = NULL;
    169169
    170     m->bd.free();
    171     unconst(m->pPeer) = NULL;
    172 
    173     delete m;
    174     m = NULL;
     170    if (m)
     171    {
     172        m->bd.free();
     173        unconst(m->pPeer) = NULL;
     174
     175        delete m;
     176        m = NULL;
     177    }
    175178}
    176179
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