~nvdajp/nvdajp/jpmain

« back to all changes in this revision

Viewing changes to nvdaHelper/nvdajpimeRPC/tls.cpp

  • Committer: Takuya Nishimoto
  • Date: 2013-03-18 06:20:49 UTC
  • Revision ID: nishimotz@gmail.com-20130318062049-ilb8njmsjydqo7hi
cleanup nvdajpime helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
#A part of NonVisual Desktop Access (NVDA)
3
 
#Copyright (C) 2010-2012 Masataka Shinke, Takuya Nishimoto (nvdajp)
4
 
#This file is covered by the GNU General Public License.
5
 
#See the file COPYING for more details.
6
 
#
7
 
# nvdajpimeRPC/tls.cpp
8
 
*/
9
 
 
10
 
#include "nvdajpime.h"
11
 
#include "tls.h"
12
 
#include "tsf.h"
13
 
#include "debugout.h"
14
 
 
15
 
// static
16
 
BOOL TLS::InternalDestroyTLS()
17
 
{
18
 
    if (dwTLSIndex == TLS_OUT_OF_INDEXES)
19
 
        return FALSE;
20
 
 
21
 
    TLS *ptls = (TLS *)TlsGetValue(dwTLSIndex);
22
 
    if (ptls != NULL)
23
 
    {
24
 
        if (ptls->_pReadCompTSF)
25
 
        {
26
 
            ptls->_pReadCompTSF->_InitTextEditSink(NULL);
27
 
            ptls->_pReadCompTSF->_UninitThreadMgrSink();
28
 
            ptls->_pReadCompTSF->Release();
29
 
            ptls->_pReadCompTSF = NULL;
30
 
            DebugOut(2, L"RPC: TLS::InternalDestroyTLS() _pReadCompTSF released.");
31
 
        }
32
 
 
33
 
        LocalFree(ptls);
34
 
        TlsSetValue(dwTLSIndex, NULL);
35
 
        return TRUE;
36
 
    }
37
 
    return FALSE;
38
 
}