diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-03-09 09:54:16 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-03-09 14:23:45 +0100 |
commit | bbcf235753dc87ef6bc6652a77239513110e2d9e (patch) | |
tree | 0636b306f11ec31554ff4618547230de9c877977 /avmedia/source | |
parent | 5e8c0e2556eebfee7b2d75403cbf5cee6642e644 (diff) |
loplugin:refcounting (clang-cl)
Change-Id: I91189ebd902b70e2fbe42fe8cc09b8677af1a5fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112194
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'avmedia/source')
-rw-r--r-- | avmedia/source/win/manager.cxx | 8 | ||||
-rw-r--r-- | avmedia/source/win/player.cxx | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/avmedia/source/win/manager.cxx b/avmedia/source/win/manager.cxx index 731effd5f80f..578ec9d2a5af 100644 --- a/avmedia/source/win/manager.cxx +++ b/avmedia/source/win/manager.cxx @@ -21,6 +21,7 @@ #include "player.hxx" #include <cppuhelper/supportsservice.hxx> +#include <rtl/ref.hxx> #include <tools/urlobj.hxx> using namespace ::com::sun::star; @@ -39,14 +40,13 @@ Manager::~Manager() uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const OUString& rURL ) { - Player* pPlayer( new Player() ); - uno::Reference< media::XPlayer > xRet( pPlayer ); + rtl::Reference<Player> pPlayer( new Player() ); const INetURLObject aURL( rURL ); if( !pPlayer->create( aURL.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ) ) ) - xRet.clear(); + pPlayer.clear(); - return xRet; + return pPlayer; } diff --git a/avmedia/source/win/player.cxx b/avmedia/source/win/player.cxx index 7990e7aecdfe..8ff8f70c9b38 100644 --- a/avmedia/source/win/player.cxx +++ b/avmedia/source/win/player.cxx @@ -29,6 +29,7 @@ #include <cppuhelper/supportsservice.hxx> #include <o3tl/char16_t2wchar_t.hxx> #include <osl/file.hxx> +#include <rtl/ref.hxx> #define AVMEDIA_WIN_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_DirectX" #define AVMEDIA_WIN_PLAYER_SERVICENAME "com.sun.star.media.Player_DirectX" @@ -407,7 +408,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co if( mpVW && aSize.Width > 0 && aSize.Height > 0 ) { - ::avmedia::win::Window* pWindow = new ::avmedia::win::Window( *this ); + rtl::Reference<::avmedia::win::Window> pWindow = new ::avmedia::win::Window( *this ); xRet = pWindow; @@ -425,7 +426,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( ) if( !maURL.isEmpty() ) { - FrameGrabber* pGrabber = new FrameGrabber(); + rtl::Reference<FrameGrabber> pGrabber = new FrameGrabber(); xRet = pGrabber; |