summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-10 13:36:34 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-11 07:16:20 +0000
commitdb17d3c17c40d6b0e92392cf3c6e343d1d17b771 (patch)
tree9d562fcf764e7717df9585ef0e735a12ea4aaa16 /slideshow
parent2ce9e4be4a438203382cb9cca824ce3e90647f3a (diff)
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 <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/transitions/slidetransitionfactory.cxx8
1 files changed, 4 insertions, 4 deletions
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 <memory>
@@ -882,7 +883,7 @@ NumberAnimationSharedPtr createPluginTransition(
const SoundPlayerSharedPtr& pSoundPlayer,
EventMultiplexer& rEventMultiplexer)
{
- PluginSlideChange* pTransition =
+ std::unique_ptr<PluginSlideChange> 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();
}
}