summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-02-27 21:31:22 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-02-28 09:54:27 +0000
commit75082a3bf7401fad10c2806a3f7ce268160d7ab1 (patch)
treea14d56da19c034ba0b7dd79e612b07a7e096b0df
parentaa8091bc25b67189dd7a43ff85ef3ae11df0971b (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.cxx2
-rw-r--r--sd/source/ui/remotecontrol/BluetoothServer.hxx4
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();