VirtualBox

Changeset 55146 in vbox


Ignore:
Timestamp:
Apr 8, 2015 4:36:24 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: UIMachineLogic: workaround for 'failed to open session' error when separate VM process terminates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r55093 r55146  
    9191/* Other VBox includes: */
    9292# include <iprt/path.h>
     93# include <iprt/thread.h>
    9394# ifdef VBOX_WITH_DEBUGGER_GUI
    9495#  include <VBox/dbggui.h>
     
    559560                /* VM has been powered off, saved, teleported or aborted.
    560561                 * We must close Runtime UI: */
     562                if (vboxGlobal().isSeparateProcess())
     563                {
     564                    /* Hack: The VM process is terminating, so wait a bit to make sure that
     565                     * the session is unlocked and the GUI process can save extradata
     566                     * in UIMachine::cleanupMachineLogic.
     567                     */
     568                    /** @todo Probably should wait for the session state change event. */
     569                    KSessionState sessionState = uisession()->session().GetState();
     570                    int c = 0;
     571                    while (   sessionState == KSessionState_Locked
     572                           || sessionState == KSessionState_Unlocking)
     573                    {
     574                         if (++c > 50) break;
     575
     576                         RTThreadSleep(100);
     577                         sessionState = uisession()->session().GetState();
     578                    }
     579                }
     580
    561581                uisession()->closeRuntimeUI();
    562582                return;
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