summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-06 21:12:05 +0100
committerTomaž Vajngerl <quikee@gmail.com>2016-05-09 10:29:39 +0000
commit6e970c11645f1a05638e49da9e2911fe59628838 (patch)
treebd0ee2f908504fabdeaf75e0cfe60f4f5d814005 /vcl
parenttdf#98290 Cmd + G as Find Next shortcut for Mac and Gnome (diff)
downloadcore-6e970c11645f1a05638e49da9e2911fe59628838.tar.gz
core-6e970c11645f1a05638e49da9e2911fe59628838.zip
cid#1358836 reorganize to silence Resource leak in object
Change-Id: I4cb51f537cf6b40748dd8902dc39362d8846ba22 Reviewed-on: https://gerrit.libreoffice.org/24708 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/opengl/PackedTextureAtlas.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/opengl/PackedTextureAtlas.cxx b/vcl/opengl/PackedTextureAtlas.cxx
index c2e124488f49..38475b1b3bdb 100644
--- a/vcl/opengl/PackedTextureAtlas.cxx
+++ b/vcl/opengl/PackedTextureAtlas.cxx
@@ -109,7 +109,7 @@ Node* Node::insert(int nWidth, int nHeight, int nPadding)
struct PackedTexture
{
- ImplOpenGLTexture* mpTexture;
+ std::unique_ptr<ImplOpenGLTexture> mpTexture;
std::unique_ptr<Node> mpRootNode;
int mnDeallocatedArea;
@@ -131,7 +131,7 @@ PackedTextureAtlasManager::~PackedTextureAtlasManager()
for (std::unique_ptr<PackedTexture>& pPackedTexture : maPackedTextures)
{
// Free texture early in VCL shutdown while we have a context.
- delete pPackedTexture->mpTexture;
+ pPackedTexture->mpTexture.reset();
}
}
@@ -151,7 +151,7 @@ OpenGLTexture PackedTextureAtlasManager::Reserve(int nWidth, int nHeight)
Node* pNode = pPackedTexture->mpRootNode->insert(nWidth, nHeight, 1);
if (pNode != nullptr)
{
- return OpenGLTexture(pPackedTexture->mpTexture, pNode->mRectangle, -1);
+ return OpenGLTexture(pPackedTexture->mpTexture.get(), pNode->mRectangle, -1);
}
}
CreateNewTexture();
@@ -159,7 +159,7 @@ OpenGLTexture PackedTextureAtlasManager::Reserve(int nWidth, int nHeight)
Node* pNode = pPackedTexture->mpRootNode->insert(nWidth, nHeight, 1);
if (pNode != nullptr)
{
- return OpenGLTexture(pPackedTexture->mpTexture, pNode->mRectangle, -1);
+ return OpenGLTexture(pPackedTexture->mpTexture.get(), pNode->mRectangle, -1);
}
return OpenGLTexture();
}