Commit bf395eb1 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msctf: Remove some duplication.

parent f2b29ecf
...@@ -183,19 +183,17 @@ static HRESULT WINAPI DocumentMgr_Pop(ITfDocumentMgr *iface, DWORD dwFlags) ...@@ -183,19 +183,17 @@ static HRESULT WINAPI DocumentMgr_Pop(ITfDocumentMgr *iface, DWORD dwFlags)
if (dwFlags == TF_POPF_ALL) if (dwFlags == TF_POPF_ALL)
{ {
if (This->contextStack[0]) int i;
{
ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink,This->contextStack[0]); for (i = 0; i < sizeof(This->contextStack)/sizeof(This->contextStack[0]); i++)
Context_Uninitialize(This->contextStack[0]); if (This->contextStack[i])
ITfContext_Release(This->contextStack[0]); {
} ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink, This->contextStack[i]);
if (This->contextStack[1]) Context_Uninitialize(This->contextStack[i]);
{ ITfContext_Release(This->contextStack[i]);
ITfThreadMgrEventSink_OnPopContext(This->ThreadMgrSink,This->contextStack[1]); This->contextStack[i] = NULL;
Context_Uninitialize(This->contextStack[1]); }
ITfContext_Release(This->contextStack[1]);
}
This->contextStack[0] = This->contextStack[1] = NULL;
ITfThreadMgrEventSink_OnUninitDocumentMgr(This->ThreadMgrSink, iface); ITfThreadMgrEventSink_OnUninitDocumentMgr(This->ThreadMgrSink, iface);
return S_OK; return S_OK;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment