summaryrefslogtreecommitdiff
path: root/vcl/opengl/x11/gdiimpl.cxx
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-12 12:51:03 -0500
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-11-13 07:54:16 +0100
commitdc189f79e844c7208220c0903309852a09c8b1c1 (patch)
tree3cbbcec5476a43842d9083dece15d9207e697ee5 /vcl/opengl/x11/gdiimpl.cxx
parentf3981e86d66e5d57e266961586a5b94ffd290fa9 (diff)
vcl: Fix memory free bugs
Change-Id: Ic8c507014f0b02c7a0baa40f3f48070301604ca4
Diffstat (limited to 'vcl/opengl/x11/gdiimpl.cxx')
-rw-r--r--vcl/opengl/x11/gdiimpl.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx
index 13b70495341a..184abab2040a 100644
--- a/vcl/opengl/x11/gdiimpl.cxx
+++ b/vcl/opengl/x11/gdiimpl.cxx
@@ -86,7 +86,7 @@ X11Pixmap* X11OpenGLSalGraphicsImpl::GetPixmapFromScreen( const Rectangle& rRect
XVisualInfo aVisualInfo;
X11Pixmap* pPixmap;
XImage* pImage;
- sal_uInt8* pData;
+ char* pData;
SAL_INFO( "vcl.opengl", "GetPixmapFromScreen" );
// TODO: lfrb: Use context depth
@@ -100,12 +100,12 @@ X11Pixmap* X11OpenGLSalGraphicsImpl::GetPixmapFromScreen( const Rectangle& rRect
glXWaitX();
// TODO: lfrb: What if offscreen?
- pData = new sal_uInt8[rRect.GetWidth() * rRect.GetHeight() * 4];
+ pData = (char*) malloc( rRect.GetWidth() * rRect.GetHeight() * 4 );
glPixelStorei( GL_PACK_ALIGNMENT, 1 );
glReadPixels( rRect.Left(), GetHeight() - rRect.Top(), rRect.GetWidth(), rRect.GetHeight(),
GL_RGBA, GL_UNSIGNED_BYTE, pData );
- pImage = XCreateImage( pDisplay, aVisualInfo.visual, 24, ZPixmap, 0, (char*) pData,
+ pImage = XCreateImage( pDisplay, aVisualInfo.visual, 24, ZPixmap, 0, pData,
rRect.GetWidth(), rRect.GetHeight(), 8, 0 );
XInitImage( pImage );
GC aGC = XCreateGC( pDisplay, pPixmap->GetPixmap(), 0, NULL );