- Timestamp:
- Oct 29, 2021 12:58:11 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/VirtualBoxClientImpl.cpp
r91718 r92144 40 40 #endif 41 41 42 #include <new> 43 42 44 43 45 /** Waiting time between probing whether VBoxSVC is alive. */ … … 84 86 case VBoxEventType_OnLanguageChanged: 85 87 { 88 /* 89 * Proceed with uttmost care as we might be racing com::Shutdown() 90 * and have the ground open up beneath us. 91 */ 92 LogFunc(("VBoxEventType_OnLanguageChanged\n")); 86 93 VirtualBoxTranslator *pTranslator = VirtualBoxTranslator::tryInstance(); 87 94 if (pTranslator) 88 95 { 89 96 ComPtr<ILanguageChangedEvent> pEvent = aEvent; 90 HRESULT rc = E_FAIL;91 97 Assert(pEvent); 92 98 99 /* This call may fail if we're racing COM shutdown. */ 93 100 com::Bstr bstrLanguageId; 94 rc = pEvent->COMGETTER(LanguageId)(bstrLanguageId.asOutParam()); 95 AssertComRC(rc); 96 97 com::Utf8Str strLanguageId(bstrLanguageId); 98 pTranslator->i_loadLanguage(strLanguageId.c_str()); 101 HRESULT hrc = pEvent->COMGETTER(LanguageId)(bstrLanguageId.asOutParam()); 102 if (SUCCEEDED(hrc)) 103 { 104 try 105 { 106 com::Utf8Str strLanguageId(bstrLanguageId); 107 LogFunc(("New language ID: %s\n", strLanguageId.c_str())); 108 pTranslator->i_loadLanguage(strLanguageId.c_str()); 109 } 110 catch (std::bad_alloc &) 111 { 112 LogFunc(("Caught bad_alloc")); 113 } 114 } 115 else 116 LogFunc(("Failed to get new language ID: %Rhrc\n", hrc)); 117 99 118 pTranslator->release(); 100 119 } … … 560 579 AutoUninitSpan autoUninitSpan(this); 561 580 if (autoUninitSpan.uninitDone()) 581 { 582 LogFlowThisFunc(("already done\n")); 562 583 return; 584 } 563 585 564 586 #ifdef VBOX_WITH_MAIN_NLS … … 589 611 590 612 ASMAtomicDecU32(&g_cInstances); 613 614 LogFlowThisFunc(("returns\n")); 591 615 } 592 616
Note:
See TracChangeset
for help on using the changeset viewer.