Kaydet (Commit) b8a32998 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 05e2fd16
...@@ -368,18 +368,7 @@ TYPEINIT1(SbUnoAnyObject,SbxObject) ...@@ -368,18 +368,7 @@ TYPEINIT1(SbUnoAnyObject,SbxObject)
// TODO: source out later // TODO: source out later
Reference<XIdlClass> TypeToIdlClass( const Type& rType ) Reference<XIdlClass> TypeToIdlClass( const Type& rType )
{ {
// register void as default class return getCoreReflection_Impl()->forName(rType.getTypeName());
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;
} }
// Exception type unknown // Exception type unknown
......
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