VirtualBox

Changeset 90935 in vbox


Ignore:
Timestamp:
Aug 27, 2021 7:58:56 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146573
Message:

FE/Qt: bugref:10067: Tiny UIConverter cleanup.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverter.cpp

    r82968 r90935  
    55
    66/*
    7  * Copyright (C) 2012-2020 Oracle Corporation
     7 * Copyright (C) 2012-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2424
    2525/* static */
    26 void UIConverter::prepare()
     26void UIConverter::create()
    2727{
    28     /* Make sure instance WAS NOT created yet: */
    29     if (s_pInstance)
    30         return;
    31 
    32     /* Prepare instance: */
    33     s_pInstance = new UIConverter;
     28    AssertReturnVoid(!s_pInstance);
     29    new UIConverter;
    3430}
    3531
    3632/* static */
    37 void UIConverter::cleanup()
     33void UIConverter::destroy()
    3834{
    39     /* Make sure instance WAS NOT destroyed yet: */
    40     if (!s_pInstance)
    41         return;
    42 
    43     /* Cleanup instance: */
     35    AssertPtrReturnVoid(s_pInstance);
    4436    delete s_pInstance;
    45     s_pInstance = 0;
    4637}
    47 
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverter.h

    r82968 r90935  
    55
    66/*
    7  * Copyright (C) 2012-2020 Oracle Corporation
     7 * Copyright (C) 2012-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3434    static UIConverter *instance() { return s_pInstance; }
    3535
    36     /** Prepares everything. */
    37     static void prepare();
    38     /** Cleanups everything. */
    39     static void cleanup();
     36    /** Creates singleton instance. */
     37    static void create();
     38    /** Destroys singleton instance. */
     39    static void destroy();
    4040
    4141    /** Converts QColor <= template class. */
     
    119119
    120120    /** Constructs converter. */
    121     UIConverter() {}
     121    UIConverter() { s_pInstance = this; }
     122    /** Destructs converter. */
     123    virtual ~UIConverter() /* override final */ { s_pInstance = 0; }
    122124
    123125    /** Holds the static instance. */
     
    129131
    130132#endif /* !FEQT_INCLUDED_SRC_converter_UIConverter_h */
    131 
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r90925 r90935  
    41344134#endif /* VBOX_WS_MAC */
    41354135
    4136     /* Prepare converter: */
    4137     UIConverter::prepare();
     4136    /* Create converter: */
     4137    UIConverter::create();
    41384138
    41394139    /* Create desktop-widget watchdog: */
     
    47054705    UIExtraDataManager::destroy();
    47064706
    4707     /* Cleanup converter: */
    4708     UIConverter::cleanup();
     4707    /* Destroy converter: */
     4708    UIConverter::destroy();
    47094709
    47104710    /* Cleanup thread-pools: */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette