sd/source/ui/remotecontrol/BluetoothServer.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
New commits: commit 638be04c8334e5e29f9258ff870fbe63603ce7e0 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Jan 8 09:27:11 2019 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Jan 8 10:18:14 2019 +0100 use unique_ptr in sd::BluetoothServer::Impl Change-Id: I54bd8fbac488182d2017e90b7afced2659f01728 Reviewed-on: https://gerrit.libreoffice.org/65955 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index f614af007e78..170a2f08396d 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -90,14 +90,13 @@ struct sd::BluetoothServer::Impl { // the glib mainloop running in the thread GMainContext *mpContext; DBusConnection *mpConnection; - DBusObject *mpService; + std::unique_ptr<DBusObject> mpService; enum class BluezVersion { BLUEZ4, BLUEZ5, UNKNOWN }; BluezVersion maBluezVersion; Impl() : mpContext( g_main_context_new() ) , mpConnection( nullptr ) - , mpService( nullptr ) , maBluezVersion( BluezVersion::UNKNOWN ) { } @@ -853,17 +852,15 @@ setDiscoverable( DBusConnection *pConnection, DBusObject *pAdapter, bool bDiscov } } -static DBusObject * +static std::unique_ptr<DBusObject> registerWithDefaultAdapter( DBusConnection *pConnection ) { - DBusObject *pService; - pService = bluez4GetDefaultService( pConnection ); + std::unique_ptr<DBusObject> pService(bluez4GetDefaultService( pConnection )); if( pService ) { - if( !bluez4RegisterServiceRecord( pConnection, pService, + if( !bluez4RegisterServiceRecord( pConnection, pService.get(), bluetooth_service_record ) ) { - delete pService; return nullptr; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits