Skip to content

Commit

Permalink
fix(candidate): fix COM pointer reference
Browse files Browse the repository at this point in the history
  • Loading branch information
nameoverflow committed Aug 28, 2018
1 parent 91cbd2c commit 63d6d9a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions WeaselTSF/CandidateList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CandidateList::CandidateList(WeaselTSF * pTextService)
_cRef = 1;
_tsf = pTextService;
_tsf->AddRef();

}

CandidateList::~CandidateList()
Expand Down Expand Up @@ -303,8 +304,9 @@ HWND CandidateList::_GetActiveWnd()
void CandidateList::_StartUI()
{
BOOL pbShow = TRUE;
ComPtr<ITfUIElementMgr> emgr;
_tsf->_pThreadMgr->QueryInterface(emgr.GetAddressOf());
ComPtr<ITfThreadMgr> pThreadMgr;
pThreadMgr.Copy(_tsf->_pThreadMgr);
ComPtr<ITfUIElementMgr> emgr = pThreadMgr.As<ITfUIElementMgr>();

if (emgr) {
if (!_ui->IsShown())
Expand All @@ -317,8 +319,9 @@ void CandidateList::_StartUI()

void CandidateList::_EndUI()
{
ComPtr<ITfUIElementMgr> emgr;
_tsf->_pThreadMgr->QueryInterface(emgr.GetAddressOf());
ComPtr<ITfThreadMgr> pThreadMgr;
pThreadMgr.Copy(_tsf->_pThreadMgr);
ComPtr<ITfUIElementMgr> emgr = pThreadMgr.As<ITfUIElementMgr>();
if (emgr)
emgr->EndUIElement(uiid);
if (_ui->IsShown())
Expand Down

0 comments on commit 63d6d9a

Please sign in to comment.