diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-02-27 21:31:22 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-02-28 09:54:27 +0000 |
commit | 75082a3bf7401fad10c2806a3f7ce268160d7ab1 (patch) | |
tree | a14d56da19c034ba0b7dd79e612b07a7e096b0df | |
parent | aa8091bc25b67189dd7a43ff85ef3ae11df0971b (diff) |
coverity#988423: fix memory leak
Change-Id: I3ac2cca7e24e6cc1b47b42c2d42bc7caee91b559
Reviewed-on: https://gerrit.libreoffice.org/2458
Reviewed-by: Michael Meeks <michael.meeks@suse.com>
Tested-by: Michael Meeks <michael.meeks@suse.com>
-rw-r--r-- | sd/source/ui/remotecontrol/BluetoothServer.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/remotecontrol/BluetoothServer.hxx | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index 9c271aaae8a9..475e0c1838b7 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 8078edeb6b81..bfaeccc09b34 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(); |