summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-11-20 19:12:16 +0100
committerJan Holesovsky <kendy@collabora.com>2014-11-20 20:58:50 +0100
commitbe5ef396a54da1a8aa4b9c23b43496f1f407e447 (patch)
tree51c2cf4cb6ccdbe64e57abd84a160340265680f0 /vcl
parent77685ab68e5892cc72ba1c7283fb6658d2516cd0 (diff)
boost::scoped_ptr instead of manual pointer lifecycle management.
Change-Id: I3b518065cead1c2805662326f063cb7b24d3d52a
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/source/gdi/salnativewidgets-luna.cxx9
-rw-r--r--vcl/win/source/gdi/winlayout.cxx3
2 files changed, 3 insertions, 9 deletions
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 8c8771029145..0789d4cd6cf9 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -1288,23 +1288,18 @@ bool WinSalGraphics::drawNativeControl( ControlType nType,
if (ImplDrawNativeControl(aBlackDC.getCompatibleHDC(), hTheme, rc, nType, nPart, nState, aValue, aCaptionStr) &&
ImplDrawNativeControl(aWhiteDC.getCompatibleHDC(), hTheme, rc, nType, nPart, nState, aValue, aCaptionStr))
{
- OpenGLTexture *pBlackTexture = aBlackDC.getTexture();
+ boost::scoped_ptr<OpenGLTexture> pBlackTexture(aBlackDC.getTexture());
if (!pBlackTexture)
return false;
- OpenGLTexture *pWhiteTexture = aWhiteDC.getTexture();
+ boost::scoped_ptr<OpenGLTexture> pWhiteTexture(aWhiteDC.getTexture());
if (!pWhiteTexture)
- {
- delete pBlackTexture;
return false;
- }
pImpl->PreDraw();
pImpl->DrawTexture(*pBlackTexture, aBlackDC.getTwoRect()); // FIXME combine the textures - DrawTextureSynthesizedAlpha()
pImpl->PostDraw();
- delete pBlackTexture;
- delete pWhiteTexture;
bOk = true;
}
}
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 3778db308536..e405e499cbc3 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -218,13 +218,12 @@ void WinLayout::DrawText(SalGraphics& rGraphics) const
WinOpenGLSalGraphicsImpl *pImpl = dynamic_cast<WinOpenGLSalGraphicsImpl*>(rWinGraphics.mpImpl.get());
if (pImpl)
{
- OpenGLTexture *pTexture = aDC.getTexture();
+ boost::scoped_ptr<OpenGLTexture> pTexture(aDC.getTexture());
if (pTexture)
{
pImpl->PreDraw();
pImpl->DrawMask(*pTexture, salColor, aDC.getTwoRect());
pImpl->PostDraw();
- delete pTexture;
}
}
}