Skip to content

Commit

Permalink
fix: fix unexpected crash in some applications
Browse files Browse the repository at this point in the history
  • Loading branch information
AlfredLouis00 committed Jan 2, 2025
1 parent 37c8fa1 commit bbc2fd2
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 bbc2fd2

Please sign in to comment.