summaryrefslogtreecommitdiff
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 19:12:16 +0100
commit632106da226bfeedbcdcd0bc43790d001f4d8155 (patch)
treecd3fe2c37625eb3f05f47c65964b6a3b6ccc9f2a
parentcab741ef1ed6171ae10f7a51f0ed8d50983ad3dd (diff)
boost::scoped_ptr instead of manual pointer lifecycle management.
Change-Id: I3b518065cead1c2805662326f063cb7b24d3d52a
-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;
}
}
}