[Libreoffice-commits] core.git: sd/source

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Feb 28 01:54:46 PST 2013


 sd/source/ui/remotecontrol/BluetoothServer.cxx |    2 +-
 sd/source/ui/remotecontrol/BluetoothServer.hxx |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 75082a3bf7401fad10c2806a3f7ce268160d7ab1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Feb 27 21:31:22 2013 +0100

    coverity#988423: fix memory leak
    
    Change-Id: I3ac2cca7e24e6cc1b47b42c2d42bc7caee91b559
    Reviewed-on: https://gerrit.libreoffice.org/2458
    Reviewed-by: Michael Meeks <michael.meeks at suse.com>
    Tested-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx
index 9c271aa..475e0c1 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.cxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx
@@ -586,7 +586,7 @@ BluetoothServer::BluetoothServer( std::vector<Communicator*>* pCommunicators )
     mpCommunicators( pCommunicators )
 {
 #ifdef LINUX_BLUETOOTH
-    mpImpl = new BluetoothServerImpl();
+    mpImpl.reset(new BluetoothServerImpl());
 #endif
     (void) mpImpl; // Avoid warning: private field 'mpImpl' is not used
 }
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.hxx b/sd/source/ui/remotecontrol/BluetoothServer.hxx
index 8078ede..bfaeccc 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.hxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.hxx
@@ -12,6 +12,8 @@
 #include <osl/thread.hxx>
 #include <vector>
 
+#include <boost/scoped_ptr.hpp>
+
 namespace sd
 {
     class Communicator;
@@ -40,7 +42,7 @@ namespace sd
         enum { UNKNOWN, DISCOVERABLE, NOT_DISCOVERABLE } meWasDiscoverable;
         static BluetoothServer *spServer;
 
-        BluetoothServerImpl *mpImpl;
+        boost::scoped_ptr<BluetoothServerImpl> mpImpl;
         virtual void SAL_CALL run();
 
         void cleanupCommunicators();


More information about the Libreoffice-commits mailing list