VirtualBox

Changeset 92143 in vbox


Ignore:
Timestamp:
Oct 29, 2021 12:52:44 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147964
Message:

VBoxManage/setproperty/language: Added 32 ms kludge waiting for the main notification about the language change to avoid trouble if we receive it during XPCOM/COM shutdown. bugref:1909

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp

    r91469 r92143  
    2828# include <VBox/com/errorprint.h>
    2929# include <VBox/com/VirtualBox.h>
     30# include <VBox/com/NativeEventQueue.h>
    3031#endif /* !VBOX_ONLY_DOCS */
    3132
     
    10521053        Bstr bstrLanguage(a->argv[1]);
    10531054        CHECK_ERROR(systemProperties, COMSETTER(LanguageId)(bstrLanguage.raw()));
     1055
     1056        /* Kudge alert! Make sure the language change notification is processed,
     1057                        otherwise it may arrive as (XP)COM shuts down and cause
     1058                        trouble in debug builds. */
     1059# ifdef DEBUG
     1060        uint64_t const tsStart = RTTimeNanoTS();
     1061# endif
     1062        unsigned cMsgs = 0;
     1063        int vrc;
     1064        while (   RT_SUCCESS(vrc = NativeEventQueue::getMainEventQueue()->processEventQueue(32 /*ms*/))
     1065               || vrc == VERR_INTERRUPTED)
     1066            cMsgs++;
     1067# ifdef DEBUG
     1068        RTPrintf("vrc=%Rrc cMsgs=%u nsElapsed=%'RU64\n", vrc, cMsgs, RTTimeNanoTS() - tsStart);
     1069# endif
    10541070    }
    10551071#endif
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