diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-09 10:00:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-14 11:17:20 +0200 |
commit | 311c5a98b8cc6d5e4ef97a59c113cfd7df59312a (patch) | |
tree | 76f80faeca67203533012b8c129471c89d0636fb /avmedia | |
parent | 89507e35e1bb4ce390d7550d2bb02edcbf74c5e7 (diff) |
loplugin:useuniqueptr in MediaWindowImpl
Change-Id: I45c9e33578f23ed368b4bff92a72b37e3c98e8e3
Reviewed-on: https://gerrit.libreoffice.org/54176
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/viewer/mediawindow_impl.cxx | 14 | ||||
-rw-r--r-- | avmedia/source/viewer/mediawindow_impl.hxx | 4 |
2 files changed, 8 insertions, 10 deletions
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index da0d87ba5ad8..75c2d9a70af2 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -164,10 +164,8 @@ void MediaWindowImpl::dispose() mpMediaWindow = nullptr; - delete mpEmptyBmpEx; - mpEmptyBmpEx = nullptr; - delete mpAudioBmpEx; - mpAudioBmpEx = nullptr; + mpEmptyBmpEx.reset(); + mpAudioBmpEx.reset(); mpMediaWindowControl.disposeAndClear(); mpChildWindow.disposeAndClear(); @@ -578,16 +576,16 @@ void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rec if (!mxPlayer.is()) { if (!mpEmptyBmpEx) - mpEmptyBmpEx = new BitmapEx(AVMEDIA_BMP_EMPTYLOGO); + mpEmptyBmpEx.reset(new BitmapEx(AVMEDIA_BMP_EMPTYLOGO)); - pLogo = mpEmptyBmpEx; + pLogo = mpEmptyBmpEx.get(); } else if (!mxPlayerWindow.is()) { if (!mpAudioBmpEx) - mpAudioBmpEx = new BitmapEx(AVMEDIA_BMP_AUDIOLOGO); + mpAudioBmpEx.reset(new BitmapEx(AVMEDIA_BMP_AUDIOLOGO)); - pLogo = mpAudioBmpEx; + pLogo = mpAudioBmpEx.get(); } if (!mpChildWindow) diff --git a/avmedia/source/viewer/mediawindow_impl.hxx b/avmedia/source/viewer/mediawindow_impl.hxx index bed32852e5ce..a313d927f1bd 100644 --- a/avmedia/source/viewer/mediawindow_impl.hxx +++ b/avmedia/source/viewer/mediawindow_impl.hxx @@ -149,8 +149,8 @@ private: rtl::Reference<MediaEventListenersImpl> mxEvents; VclPtr<MediaChildWindow> mpChildWindow; VclPtr<MediaWindowControl> mpMediaWindowControl; - BitmapEx* mpEmptyBmpEx; - BitmapEx* mpAudioBmpEx; + std::unique_ptr<BitmapEx> mpEmptyBmpEx; + std::unique_ptr<BitmapEx> mpAudioBmpEx; }; }} // end namespace avmedia::priv |