VirtualBox

Ignore:
Timestamp:
Dec 15, 2017 2:08:04 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8900: No need to manually close QIManagerDialog dialogs, it's ignored anyway; Protect QIManagerDialog against cascade closing, that can cause crash due to race (mostly on X11).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.cpp

    r70139 r70147  
    6161QIManagerDialog::QIManagerDialog(QWidget *pCenterWidget)
    6262    : pCenterWidget(pCenterWidget)
     63    , m_fCloseEmitted(false)
    6364    , m_pWidget(0)
    6465    , m_pWidgetMenu(0)
     
    223224    /* Ignore the event itself: */
    224225    pEvent->ignore();
    225     /* But tell the listener to close us: */
    226     emit sigClose();
     226    /* But tell the listener to close us (once): */
     227    if (!m_fCloseEmitted)
     228    {
     229        m_fCloseEmitted = true;
     230        emit sigClose();
     231    }
    227232}
    228233
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.h

    r70139 r70147  
    165165    /** @} */
    166166
    167         /** @name Functions related to geometry restoration.
    168          * @{ */
    169         /* Sets the position and size of the dialog. */
     167    /** @name Functions related to geometry restoration.
     168     * @{ */
     169        /** Sets the position and size of the dialog. */
    170170        void setDialogGeometry(const QRect &geometry);
    171171        /** Returns whether the window should be maximized when geometry being restored. */
    172172        virtual bool shouldBeMaximized() const { return false; }
    173         /** @} */
     173    /** @} */
    174174
    175175private:
     
    179179        /** Holds the widget reference to center Host Network Manager according. */
    180180        QWidget *pCenterWidget;
     181
     182        /** Holds whether the manager had emitted command to be closed. */
     183        bool m_fCloseEmitted;
    181184    /** @} */
    182185
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r70074 r70147  
    453453    /* Destroy instance if still exists: */
    454454    if (m_pManagerVirtualMedia)
    455     {
    456         m_pManagerVirtualMedia->close();
    457455        UIMediumManagerFactory().cleanup(m_pManagerVirtualMedia);
    458     }
    459456}
    460457
     
    486483    /* Destroy instance if still exists: */
    487484    if (m_pManagerHostNetwork)
    488     {
    489         m_pManagerHostNetwork->close();
    490485        UIHostNetworkManagerFactory().cleanup(m_pManagerHostNetwork);
    491     }
    492486}
    493487
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