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

UNO objects must be allocated on the heap

This was a regression introduced with 5ea7e74c
"fix some memory leaks in sd."

Change-Id: Ibcb2527b396886a5a904d8843c8560765ed859f5
üst 1e1ba861
......@@ -331,7 +331,8 @@ Sequence< OUString > SlideLayoutController_getSupportedServiceNames() throw( Ru
Reference< XInterface > SAL_CALL SlideLayoutController_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
{
return SlideLayoutController( rSMgr, ".uno:AssignLayout", false );
return static_cast< cppu::OWeakObject * >(
new SlideLayoutController( rSMgr, ".uno:AssignLayout", false ));
}
// --------------------------------------------------------------------
......@@ -354,7 +355,8 @@ Sequence< OUString > InsertSlideController_getSupportedServiceNames() throw( Ru
Reference< XInterface > SAL_CALL InsertSlideController_createInstance( const Reference< XMultiServiceFactory >& rSMgr ) throw( RuntimeException )
{
return SlideLayoutController( rSMgr, ".uno:InsertPage" , true );
return static_cast< cppu::OWeakObject * >(
new SlideLayoutController( rSMgr, ".uno:InsertPage" , true ) );
}
//========================================================================
......
......@@ -100,7 +100,8 @@ namespace sd { namespace toolpanel
//------------------------------------------------------------------------------------------------------------------
Reference< XInterface > SAL_CALL ToolPanelFactory_createInstance( const Reference< XComponentContext >& i_rContext )
{
return Reference< XInterface >( ToolPanelFactory( i_rContext ) );
return static_cast< cppu::OWeakObject * >(
new ToolPanelFactory( i_rContext ) );
}
//------------------------------------------------------------------------------------------------------------------
......
......@@ -515,7 +515,8 @@ rtl::OUString SdFilterDetect::impl_getStaticImplementationName()
/* Helper for registry */
UNOREFERENCE< UNOXINTERFACE > SAL_CALL SdFilterDetect::impl_createInstance( const UNOREFERENCE< UNOXMULTISERVICEFACTORY >& xServiceManager ) throw( UNOEXCEPTION )
{
return UNOREFERENCE< UNOXINTERFACE >( SdFilterDetect( xServiceManager ) );
return static_cast< cppu::OWeakObject * >(
new SdFilterDetect( xServiceManager ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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