From db17d3c17c40d6b0e92392cf3c6e343d1d17b771 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 10 Nov 2015 13:36:34 +0200 Subject: new loplugin: memoryvar detect when we can convert a new/delete sequence on a local variable to use std::unique_ptr Change-Id: Iecae4e4197eccdfacfce2eed39aa4a69e4a660bc Reviewed-on: https://gerrit.libreoffice.org/19884 Tested-by: Jenkins Reviewed-by: Noel Grandin --- slideshow/source/engine/transitions/slidetransitionfactory.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'slideshow/source') diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx index e40cd310354f..3e674c397a53 100644 --- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx @@ -44,6 +44,7 @@ #include "clippingfunctor.hxx" #include "combtransition.hxx" #include "tools.hxx" +#include @@ -882,7 +883,7 @@ NumberAnimationSharedPtr createPluginTransition( const SoundPlayerSharedPtr& pSoundPlayer, EventMultiplexer& rEventMultiplexer) { - PluginSlideChange* pTransition = + std::unique_ptr pTransition( new PluginSlideChange( nTransitionType, nTransitionSubType, @@ -892,13 +893,12 @@ NumberAnimationSharedPtr createPluginTransition( rScreenUpdater, xFactory, pSoundPlayer, - rEventMultiplexer ); + rEventMultiplexer )); if( pTransition->Success() ) - return NumberAnimationSharedPtr( pTransition ); + return NumberAnimationSharedPtr( pTransition.release() ); else { - delete pTransition; return NumberAnimationSharedPtr(); } } -- cgit