diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-09 09:59:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-14 11:11:42 +0200 |
commit | 89507e35e1bb4ce390d7550d2bb02edcbf74c5e7 (patch) | |
tree | 6eacdadd2698e2c9f0c9bd98ed68b7c388f3996c /avmedia/source | |
parent | 5c3816cce5054ef41af441f9a280a8025ff6d691 (diff) |
loplugin:useuniqueptr in MediaFloater
Change-Id: Ibdf838b630fdd63f549b59f69ee05c2030326fa5
Reviewed-on: https://gerrit.libreoffice.org/54175
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'avmedia/source')
-rw-r--r-- | avmedia/source/framework/mediaplayer.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx index dad2b2ddbd24..717f99369e7f 100644 --- a/avmedia/source/framework/mediaplayer.cxx +++ b/avmedia/source/framework/mediaplayer.cxx @@ -74,8 +74,7 @@ void MediaFloater::dispose() Show(false, ShowFlags::NoFocusChange); SetFloatingMode(false); } - delete mpMediaWindow; - mpMediaWindow = nullptr; + mpMediaWindow.reset(); SfxDockingWindow::dispose(); } @@ -93,15 +92,14 @@ void MediaFloater::ToggleFloatingMode() if (mpMediaWindow) mpMediaWindow->updateMediaItem( aRestoreItem ); - delete mpMediaWindow; - mpMediaWindow = nullptr; + mpMediaWindow.reset(); SfxDockingWindow::ToggleFloatingMode(); if (isDisposed()) return; - mpMediaWindow = new MediaWindow( this, true ); + mpMediaWindow.reset( new MediaWindow( this, true ) ); mpMediaWindow->setPosSize( tools::Rectangle( Point(), GetOutputSizePixel() ) ); mpMediaWindow->executeMediaItem( aRestoreItem ); |