VirtualBox

Changeset 66256 in vbox


Ignore:
Timestamp:
Mar 27, 2017 9:21:39 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114177
Message:

FE/Qt: bugref:8783: Move the native filter cleanup call to corresponding place, right before the machine-view destruction, preventing crash in certain conditions; Adjust corresponding source code location as well.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
2 edited

Legend:

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

    r65381 r66256  
    246246        return;
    247247
    248     /* Cleanup filters: */
    249     pMachineView->cleanupFilters();
    250 
    251248    /* Cleanup frame-buffer: */
    252249    pMachineView->cleanupFrameBuffer();
     
    259256    }
    260257#endif
     258
     259    /* Cleanup native filters: */
     260    pMachineView->cleanupNativeFilters();
     261
    261262    delete pMachineView;
    262263}
     
    862863}
    863864
    864 void UIMachineView::cleanupFilters()
    865 {
    866 #if QT_VERSION >= 0x050000
    867     /* If native event filter exists: */
    868     if (m_pNativeEventFilter)
    869     {
    870         /* Uninstall/destroy existing native event filter: */
    871         qApp->removeNativeEventFilter(m_pNativeEventFilter);
    872         delete m_pNativeEventFilter;
    873         m_pNativeEventFilter = 0;
    874     }
    875 #endif
    876 }
    877 
    878865void UIMachineView::cleanupFrameBuffer()
    879866{
     
    903890    /* Detach framebuffer from view: */
    904891    m_pFrameBuffer->setView(NULL);
     892}
     893
     894void UIMachineView::cleanupNativeFilters()
     895{
     896#if QT_VERSION >= 0x050000
     897    /* If native event filter exists: */
     898    if (m_pNativeEventFilter)
     899    {
     900        /* Uninstall/destroy existing native event filter: */
     901        qApp->removeNativeEventFilter(m_pNativeEventFilter);
     902        delete m_pNativeEventFilter;
     903        m_pNativeEventFilter = 0;
     904    }
     905#endif
    905906}
    906907
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h

    r63578 r66256  
    179179    /* Prepare routines: */
    180180    virtual void loadMachineViewSettings();
     181    //virtual void prepareNativeFilters() {}
    181182    virtual void prepareViewport();
    182183    virtual void prepareFrameBuffer();
     
    189190    //virtual void cleanupConsoleConnections() {}
    190191    //virtual void cleanupConnections() {}
    191     virtual void cleanupFilters();
     192    //virtual void cleanupFilters() {}
    192193    //virtual void cleanupCommon() {}
    193194    virtual void cleanupFrameBuffer();
    194195    //virtual void cleanupViewport();
     196    virtual void cleanupNativeFilters();
    195197    //virtual void saveMachineViewSettings() {}
    196198
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