diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-08 12:29:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-14 11:50:00 +0200 |
commit | 8447d31e529985ef7fc71933f0e55685530f9fc9 (patch) | |
tree | c8f01ee85837024482ab77c8770c8bca442ddd06 /vcl/opengl | |
parent | 1cf27cb44380f4a2bd6778c2dbbdef2a2a00cbc8 (diff) |
return SalBitmap using std::shared_ptr
since we hold it like that in Bitmap anyway
Change-Id: I6264dfaaae6210cb008df5db8a421fc80c508f5b
Reviewed-on: https://gerrit.libreoffice.org/55458
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/opengl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 6858a2adbae7..8deae07a3b77 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1722,20 +1722,19 @@ void OpenGLSalGraphicsImpl::drawMask( PostBatchDraw(); } -SalBitmap* OpenGLSalGraphicsImpl::getBitmap( long nX, long nY, long nWidth, long nHeight ) +std::shared_ptr<SalBitmap> OpenGLSalGraphicsImpl::getBitmap( long nX, long nY, long nWidth, long nHeight ) { FlushDeferredDrawing(); OpenGLZone aZone; - OpenGLSalBitmap* pBitmap = new OpenGLSalBitmap; + std::shared_ptr<OpenGLSalBitmap> pBitmap(std::make_shared<OpenGLSalBitmap>()); VCL_GL_INFO( "::getBitmap " << nX << "," << nY << " " << nWidth << "x" << nHeight ); //TODO really needed? PreDraw(); if( !pBitmap->Create( maOffscreenTex, nX, nY, nWidth, nHeight ) ) { - delete pBitmap; pBitmap = nullptr; } PostDraw(); |