summaryrefslogtreecommitdiff
path: root/include/vcl/glyphitem.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-10 20:17:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-11 11:14:05 +0200
commitadfd91d24678053b9a1475ad6985eb1fc548706a (patch)
treea401a82a5f02f505f5414df4424d5d3d2a55e435 /include/vcl/glyphitem.hxx
parent5b01ad53aba40956a164500c4267990f7d2d8dd7 (diff)
fix leak in SalLayoutGlyphs
we forgot to delete the extra impls vector Also make more use of std::unique_ptr Change-Id: I2c745c0ad2b7ad62d368e9702bd2c32c734442fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115375 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/vcl/glyphitem.hxx')
-rw-r--r--include/vcl/glyphitem.hxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/vcl/glyphitem.hxx b/include/vcl/glyphitem.hxx
index d928bb954ee7..68f89701b2c3 100644
--- a/include/vcl/glyphitem.hxx
+++ b/include/vcl/glyphitem.hxx
@@ -24,6 +24,7 @@
#include <vcl/dllapi.h>
#include <vector>
+#include <memory>
typedef sal_uInt16 sal_GlyphId;
@@ -31,14 +32,14 @@ class SalLayoutGlyphsImpl;
class VCL_DLLPUBLIC SalLayoutGlyphs final
{
- SalLayoutGlyphsImpl* m_pImpl = nullptr;
+ std::unique_ptr<SalLayoutGlyphsImpl> m_pImpl;
// Extra items are in a dynamically allocated vector in order to save memory.
// The usual case should be that this stays unused (it should be only used
// when font fallback takes place).
- std::vector<SalLayoutGlyphsImpl*>* m_pExtraImpls = nullptr;
+ std::unique_ptr<std::vector<std::unique_ptr<SalLayoutGlyphsImpl>>> m_pExtraImpls;
public:
- SalLayoutGlyphs() = default;
+ SalLayoutGlyphs();
SalLayoutGlyphs(const SalLayoutGlyphs&) = delete;
SalLayoutGlyphs(SalLayoutGlyphs&&);
~SalLayoutGlyphs();