Skip to content

Commit

Permalink
fix: fix unexpected crash in some applications (#1458)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfredLouis00 authored Jan 2, 2025
1 parent 235308d commit 3f1e05b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions WeaselTSF/CandidateList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,14 @@ void CCandidateList::StartUI() {

void CCandidateList::EndUI() {
com_ptr<ITfThreadMgr> pThreadMgr = _tsf->_GetThreadMgr();
com_ptr<ITfUIElementMgr> emgr;
auto hr = pThreadMgr->QueryInterface(&emgr);
if (FAILED(hr))
return;
if (emgr != NULL)
emgr->EndUIElement(uiid);
if (pThreadMgr) {
com_ptr<ITfUIElementMgr> emgr;
auto hr = pThreadMgr->QueryInterface(&emgr);
if (FAILED(hr))
return;
if (emgr != NULL)
emgr->EndUIElement(uiid);
}
_DisposeUIWindow();
}

Expand Down

0 comments on commit 3f1e05b

Please sign in to comment.