VirtualBox

Changeset 88678 in vbox


Ignore:
Timestamp:
Apr 23, 2021 1:33:28 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8161: Fixing regression in r143970; We should detach UISession COM stuff before COM itself is cleaned up; Otherwise any VM appears in aborted state on XPCOM hosts.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r88664 r88678  
    46584658    {
    46594659        /* First, make sure we don't use COM any more: */
     4660        emit sigAskToDetachCOM();
    46604661        m_comHost.detach();
    46614662        m_comVBox.detach();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r88656 r88678  
    7373    /** @name Common stuff.
    7474     * @{ */
    75         /** Asks #UIStarter listener to commit data. */
    76         void sigAskToCommitData();
    77     /** @} */
    78 
    79     /** @name COM stuff.
    80      * @{ */
    8175        /** Asks #UIStarter listener to restart UI. */
    8276        void sigAskToRestartUI();
     
    8680        /** Notifies listeners about the VBoxSVC availability change. */
    8781        void sigVBoxSVCAvailabilityChange();
     82
     83        /** Asks listeners to commit data. */
     84        void sigAskToCommitData();
     85        /** Asks listeners to detach COM. */
     86        void sigAskToDetachCOM();
    8887    /** @} */
    8988
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r88249 r88678  
    10071007void UIMachineView::cleanupFrameBuffer()
    10081008{
     1009    /* Make sure framebuffer assigned at all: */
     1010    if (!m_pFrameBuffer)
     1011        return;
     1012
    10091013    /* Make sure proper framebuffer assigned: */
    1010     AssertReturnVoid(m_pFrameBuffer);
    10111014    AssertReturnVoid(m_pFrameBuffer == uisession()->frameBuffer(screenId()));
    10121015
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r88247 r88678  
    2525#include <QAbstractScrollArea>
    2626#include <QEventLoop>
     27#include <QPointer>
    2728
    2829/* GUI includes: */
    2930#include "UIExtraDataDefs.h"
     31#include "UIFrameBuffer.h"
    3032#include "UIMachineDefs.h"
    3133#ifdef VBOX_WITH_DRAG_AND_DROP
     
    5254class UIMachineLogic;
    5355class UIMachineWindow;
    54 class UIFrameBuffer;
    5556class UINativeEventFilter;
    5657class CConsole;
     
    356357    UIMachineWindow *m_pMachineWindow;
    357358    ulong m_uScreenId;
    358     UIFrameBuffer *m_pFrameBuffer;
     359    QPointer<UIFrameBuffer> m_pFrameBuffer;
    359360    KMachineState m_previousState;
    360361    /** HACK: when switching out of fullscreen or seamless we wish to override
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r88648 r88678  
    589589    /* Mount medium add-hoc: */
    590590    mountAdHocImage(KDeviceType_DVD, UIMediumDeviceType_DVD, strSource);
     591}
     592
     593void UISession::sltDetachCOM()
     594{
     595    /* Cleanup everything COM related: */
     596    cleanupConsoleEventHandlers();
     597    cleanupFramebuffers();
     598    cleanupSession();
    591599}
    592600
     
    11161124{
    11171125    connect(this, &UISession::sigInitialized, this, &UISession::sltMarkInitialized);
     1126    connect(&uiCommon(), &UICommon::sigAskToDetachCOM, this, &UISession::sltDetachCOM);
    11181127
    11191128#ifdef VBOX_WS_MAC
     
    14951504    saveSessionSettings();
    14961505
    1497     /* Cleanup framebuffers: */
    1498     cleanupFramebuffers();
    1499 
    1500     /* Cleanup console event-handlers: */
    1501     cleanupConsoleEventHandlers();
    1502 
    15031506    /* Cleanup connections: */
    15041507    cleanupConnections();
     
    15061509    /* Cleanup actions: */
    15071510    cleanupActions();
    1508 
    1509     /* Cleanup session: */
    1510     cleanupSession();
    15111511}
    15121512
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r88633 r88678  
    365365    void sltMarkInitialized() { m_fInitialized = true; }
    366366
     367    /** Detaches COM. */
     368    void sltDetachCOM();
    367369    /** Close Runtime UI. */
    368370    void sltCloseRuntimeUI();
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