summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-05-28 14:23:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-05-28 14:34:12 +0200
commitb8a329989cead1db2e4b11ee41368010e55a7ce8 (patch)
tree3402558cac8ac7b164496b3742aaafe7ccd1fb03
parent05e2fd162ef86ebe4ea2a2a679cabeae33e844f0 (diff)
Fix memory leak (missing typelib_TypeDescription_release)
...by radically simplifying TypeToIdlClass(). It is unclear to me why this was so complicated. The only mildly plausible reaons would be that the old code was careful to return null instead of throwing an exception for an unknown type, but the TypeToIdlClass-call-sites either strongly expect a non-null return value (by dereferencing it without any further checking) or use OSL_ASSERT or similar to verify it. So lets hope this is good. Change-Id: I3e24eb6117e84c9d33f4c5f0e2fa88da4c4f2c30
-rw-r--r--basic/source/classes/sbunoobj.cxx13
1 files changed, 1 insertions, 12 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 7e5dcfd10ba9..3c4d1b390a47 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -368,18 +368,7 @@ TYPEINIT1(SbUnoAnyObject,SbxObject)
// TODO: source out later
Reference<XIdlClass> TypeToIdlClass( const Type& rType )
{
- // register void as default class
- Reference<XIdlClass> xRetClass;
- typelib_TypeDescription * pTD = 0;
- rType.getDescription( &pTD );
-
- if( pTD )
- {
- OUString sOWName( pTD->pTypeName );
- Reference< XIdlReflection > xRefl = getCoreReflection_Impl();
- xRetClass = xRefl->forName( sOWName );
- }
- return xRetClass;
+ return getCoreReflection_Impl()->forName(rType.getTypeName());
}
// Exception type unknown