[Libreoffice-commits] core.git: include/svx svx/source
Noel Grandin
noel.grandin at collabora.co.uk
Tue Feb 6 10:46:30 UTC 2018
include/svx/svdetc.hxx | 3 ++-
svx/source/svdraw/svdetc.cxx | 3 +--
2 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 2589cb2a7eba778c249eaa938eb1bf934c6bf3b4
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon Feb 5 10:05:13 2018 +0200
loplugin:useuniqueptr in OLEObjCache
Change-Id: Ie16963e2b3b9d85d5640f03daa487dbe231af4a1
Reviewed-on: https://gerrit.libreoffice.org/49272
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx
index ef62a825245a..20d37c3c6d4f 100644
--- a/include/svx/svdetc.hxx
+++ b/include/svx/svdetc.hxx
@@ -27,6 +27,7 @@
#include <tools/fract.hxx>
#include <vcl/outdev.hxx>
#include <svx/svdobj.hxx>
+#include <memory>
/**
@@ -162,7 +163,7 @@ class OLEObjCache
std::vector<SdrOle2Obj*> maObjs;
size_t nSize;
- AutoTimer* pTimer;
+ std::unique_ptr<AutoTimer> pTimer;
static bool UnloadObj( SdrOle2Obj* pObj );
DECL_LINK( UnloadCheckHdl, Timer*, void );
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index aa92b123be97..3c6924affdc4 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -108,7 +108,7 @@ OLEObjCache::OLEObjCache()
nSize = officecfg::Office::Common::Cache::DrawingEngine::OLE_Objects::get();
else
nSize = 100;
- pTimer = new AutoTimer( "svx OLEObjCache pTimer UnloadCheck" );
+ pTimer.reset( new AutoTimer( "svx OLEObjCache pTimer UnloadCheck" ) );
pTimer->SetInvokeHandler( LINK(this, OLEObjCache, UnloadCheckHdl) );
pTimer->SetTimeout(20000);
pTimer->SetStatic();
@@ -117,7 +117,6 @@ OLEObjCache::OLEObjCache()
OLEObjCache::~OLEObjCache()
{
pTimer->Stop();
- delete pTimer;
}
IMPL_LINK_NOARG(OLEObjCache, UnloadCheckHdl, Timer*, void)
More information about the Libreoffice-commits
mailing list