[Libreoffice-commits] .: svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 7 03:44:24 PST 2013


 svx/source/tbxctrls/tbunosearchcontrollers.cxx |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 5637b244cfe0c6b886188f71d3f974ef72abb9cd
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jan 7 12:43:26 2013 +0100

    UNO objects must be allocated on the heap
    
    This was a regression introduced with 6da90944b5134d65bfbd7dcaf024956aa139efc1
    "ugly memory leak."
    
    Change-Id: Ie976d7ddcdac974aeeba14ffd64c4641b5d096a4

diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 91efdc3..9cda390 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -767,25 +767,30 @@ void SAL_CALL FindbarDispatcher::removeStatusListener( const css::uno::Reference
 css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_createInstance(
     const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
 {
-    return FindTextToolbarController( rSMgr );
+    return static_cast< cppu::OWeakObject * >(
+        new FindTextToolbarController( rSMgr ) );
 }
 
 css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance(
     const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
 {
-    return UpDownSearchToolboxController( rSMgr, UpDownSearchToolboxController::DOWN );
+    return static_cast< cppu::OWeakObject * >(
+        new UpDownSearchToolboxController(
+            rSMgr, UpDownSearchToolboxController::DOWN ) );
 }
 
 css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance(
     const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
 {
-    return UpDownSearchToolboxController( rSMgr, UpDownSearchToolboxController::UP );
+    return static_cast< cppu::OWeakObject * >(
+        new UpDownSearchToolboxController(
+            rSMgr, UpDownSearchToolboxController::UP ) );
 }
 
 css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance(
     const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr )
 {
-    return FindbarDispatcher( rSMgr );
+    return static_cast< cppu::OWeakObject * >( new FindbarDispatcher( rSMgr ) );
 }
 
 //-----------------------------------------------------------------------------------------------------------


More information about the Libreoffice-commits mailing list