summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-02-22 21:56:18 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-02-23 08:49:32 +0100
commit802ac3e437bff5bfbc530c91105f0c380abd62fc (patch)
tree81dd51ff4f10936e358a52e2a2af4a5960538a38 /cppu
parent3534eef59d04ca22323330245fe91c758072f758 (diff)
Assert IdContainer's bInit in uno_releaseIdFromCurrentThread
...implying that pLocalThreadId, nRefCountOfCurrentId, pCurrentId are initialized, implying that zero-initializing them during construction isn't necessary. Change-Id: I98399203694edde14abc664a82861ba50dfb357c
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/threadpool/current.cxx2
-rw-r--r--cppu/source/threadpool/threadident.cxx1
2 files changed, 2 insertions, 1 deletions
diff --git a/cppu/source/threadpool/current.cxx b/cppu/source/threadpool/current.cxx
index eafb0bbb0705..1b82a02d30cc 100644
--- a/cppu/source/threadpool/current.cxx
+++ b/cppu/source/threadpool/current.cxx
@@ -163,7 +163,7 @@ IdContainer * getIdContainer()
IdContainer * pId = static_cast< IdContainer * >( ::osl_getThreadKeyData( aKey ) );
if (! pId)
{
- pId = new IdContainer();
+ pId = new IdContainer;
pId->pCurrentContext = nullptr;
pId->pCurrentContextEnv = nullptr;
pId->bInit = false;
diff --git a/cppu/source/threadpool/threadident.cxx b/cppu/source/threadpool/threadident.cxx
index a9b1dcefd623..24037f6e4d2e 100644
--- a/cppu/source/threadpool/threadident.cxx
+++ b/cppu/source/threadpool/threadident.cxx
@@ -85,6 +85,7 @@ extern "C" void SAL_CALL uno_releaseIdFromCurrentThread()
{
IdContainer *p = getIdContainer();
OSL_ASSERT( p );
+ OSL_ASSERT( p->bInit );
OSL_ASSERT( p->nRefCountOfCurrentId );
p->nRefCountOfCurrentId --;