summaryrefslogtreecommitdiff
path: root/dtrans
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-07-06 08:17:09 +0000
committerOliver Bolte <obo@openoffice.org>2005-07-06 08:17:09 +0000
commitd20ceede1b3b51a9491b799980055fd4a8cf3f3a (patch)
treeb65c5aad97cd6bc0a9e87e5605987b5c093dfcbb /dtrans
parent248b43dadb1abdc2a34c8c9363898be515881776 (diff)
INTEGRATION: CWS vcl41 (1.4.12); FILE MERGED
2005/06/16 15:24:36 pl 1.4.12.1: #123063# fix a memory leak
Diffstat (limited to 'dtrans')
-rw-r--r--dtrans/source/X11/bmp.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/dtrans/source/X11/bmp.cxx b/dtrans/source/X11/bmp.cxx
index c840acfba46f..10c21af6c6c8 100644
--- a/dtrans/source/X11/bmp.cxx
+++ b/dtrans/source/X11/bmp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bmp.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: hr $ $Date: 2004-09-08 15:52:56 $
+ * last change: $Author: obo $ $Date: 2005-07-06 09:17:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -427,7 +427,8 @@ void x11::X11_freeBmp( sal_uInt8* pBmp )
PixmapHolder::PixmapHolder( Display* pDisplay ) :
m_pDisplay( pDisplay ),
m_aColormap( None ),
- m_aPixmap( None )
+ m_aPixmap( None ),
+ m_aBitmap( None )
{
/* try to get a 24 bit true color visual, if that fails,
* revert to default visual
@@ -696,6 +697,11 @@ Pixmap PixmapHolder::setBitmapData( const sal_uInt8* pData )
sal_uInt32 nWidth = readLE32( pData+4 );
sal_uInt32 nHeight = readLE32( pData+8 );
+ if( m_aPixmap != None )
+ XFreePixmap( m_pDisplay, m_aPixmap ), m_aPixmap = None;
+ if( m_aBitmap != None )
+ XFreePixmap( m_pDisplay, m_aBitmap ), m_aBitmap = None;
+
m_aPixmap = XCreatePixmap( m_pDisplay,
RootWindow( m_pDisplay, m_aInfo.screen ),
nWidth, nHeight, m_aInfo.depth );