Kaydet (Commit) cee950b5 authored tarafından Caolán McNamara's avatar Caolán McNamara

only call XFreePixmap on pixmaps created via XCreatePixmap

not on those belonging to gdk shoe-horned in via

mpPixmap = GDK_PIXMAP_XID( mpGdkPixmap );

in GdkX11Pixmap::GdkX11Pixmap

This stops file->new->presentation crashing on second invocation

Change-Id: Iec673497f900b0ddabd439369b9ffe554800d425
üst 6df3d5e9
......@@ -36,6 +36,7 @@ protected:
Display* mpDisplay;
SalX11Screen mnScreen;
Pixmap mpPixmap;
bool mbDeletePixmap;
int mnWidth;
int mnHeight;
int mnDepth;
......
......@@ -13,6 +13,7 @@ X11Pixmap::X11Pixmap()
: mpDisplay( NULL )
, mnScreen( 0 )
, mpPixmap( 0 )
, mbDeletePixmap( false )
, mnWidth( -1 )
, mnHeight( -1 )
, mnDepth( 0 )
......@@ -22,6 +23,7 @@ X11Pixmap::X11Pixmap()
X11Pixmap::X11Pixmap( Display* pDisplay, SalX11Screen nScreen, int nWidth, int nHeight, int nDepth )
: mpDisplay( pDisplay )
, mnScreen( nScreen )
, mbDeletePixmap( true )
, mnWidth( nWidth )
, mnHeight( nHeight )
, mnDepth( nDepth )
......@@ -33,17 +35,19 @@ X11Pixmap::X11Pixmap( Display* pDisplay, SalX11Screen nScreen, int nWidth, int n
X11Pixmap::X11Pixmap( X11Pixmap& rOther )
: mpDisplay( rOther.mpDisplay )
, mnScreen( rOther.mnScreen )
, mbDeletePixmap( rOther.mbDeletePixmap )
, mnWidth( rOther.mnWidth )
, mnHeight( rOther.mnHeight )
, mnDepth( rOther.mnDepth )
{
mpPixmap = rOther.mpPixmap;
rOther.mpPixmap = 0;
rOther.mbDeletePixmap = false;
}
X11Pixmap::~X11Pixmap()
{
if( mpPixmap )
if (mbDeletePixmap && mpPixmap)
XFreePixmap( mpDisplay, mpPixmap );
}
......
......@@ -290,7 +290,7 @@ GdkX11Pixmap::GdkX11Pixmap( int nWidth, int nHeight, int nDepth )
}
GdkX11Pixmap::GdkX11Pixmap( X11Pixmap& rOther, GdkWindow *pWindow )
: X11Pixmap( rOther )
: X11Pixmap(rOther)
{
GdkColormap* pColormap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment