summaryrefslogtreecommitdiff
path: root/vcl/unx/generic/gdi
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-30 15:13:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-02 10:20:01 +0200
commit2ae289d67413a4f060b268a4483c3452c14aed42 (patch)
treec7448b4d4e001a3da1fec082fbd27a64b595b3f5 /vcl/unx/generic/gdi
parenteef7d1614ee279dfe43e0a4b575d96e0e7e9470c (diff)
loplugin:useuniqueptr in GlyphCacheHolder
Change-Id: I09aca185c6ca2efee037225e9924876030f47efe Reviewed-on: https://gerrit.libreoffice.org/53705 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic/gdi')
-rw-r--r--vcl/unx/generic/gdi/gcach_xpeer.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/vcl/unx/generic/gdi/gcach_xpeer.cxx b/vcl/unx/generic/gdi/gcach_xpeer.cxx
index 172fd4e45721..863d0a77cf8a 100644
--- a/vcl/unx/generic/gdi/gcach_xpeer.cxx
+++ b/vcl/unx/generic/gdi/gcach_xpeer.cxx
@@ -61,29 +61,24 @@ namespace
struct GlyphCacheHolder
{
private:
- X11GlyphCache* m_pX11GlyphCache;
+ std::unique_ptr<X11GlyphCache> m_pX11GlyphCache;
GlyphCacheHolder(const GlyphCacheHolder&) = delete;
GlyphCacheHolder& operator=(const GlyphCacheHolder&) = delete;
public:
GlyphCacheHolder()
+ : m_pX11GlyphCache(new X11GlyphCache)
{
- m_pX11GlyphCache = new X11GlyphCache;
}
void release()
{
- delete m_pX11GlyphCache;
- m_pX11GlyphCache = nullptr;
+ m_pX11GlyphCache.reset();
}
X11GlyphCache& getGlyphCache()
{
return *m_pX11GlyphCache;
}
- ~GlyphCacheHolder()
- {
- release();
- }
};
struct theGlyphCacheHolder :