VirtualBox

Changeset 45335 in vbox for trunk/src


Ignore:
Timestamp:
Apr 4, 2013 10:54:15 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Progress-dialog: Protect against crash on self-destructing in own event-loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp

    r45193 r45335  
    153153#endif /* Q_WS_MAC */
    154154
    155         /* Enter the modal loop, but don't show the window immediately */
    156         exec(false);
     155        /* Create a local event-loop: */
     156        {
     157            /* Guard ourself for the case
     158             * we destroyed ourself in our event-loop: */
     159            QPointer<UIProgressDialog> guard = this;
     160
     161            /* Enter the modal loop, but don't show the window immediately: */
     162            exec(false);
     163
     164            /* Are we still valid? */
     165            if (guard.isNull())
     166                return Rejected;
     167        }
    157168
    158169        /* Kill refresh timer */
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