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: ...@@ -36,6 +36,7 @@ protected:
Display* mpDisplay; Display* mpDisplay;
SalX11Screen mnScreen; SalX11Screen mnScreen;
Pixmap mpPixmap; Pixmap mpPixmap;
bool mbDeletePixmap;
int mnWidth; int mnWidth;
int mnHeight; int mnHeight;
int mnDepth; int mnDepth;
......
...@@ -13,6 +13,7 @@ X11Pixmap::X11Pixmap() ...@@ -13,6 +13,7 @@ X11Pixmap::X11Pixmap()
: mpDisplay( NULL ) : mpDisplay( NULL )
, mnScreen( 0 ) , mnScreen( 0 )
, mpPixmap( 0 ) , mpPixmap( 0 )
, mbDeletePixmap( false )
, mnWidth( -1 ) , mnWidth( -1 )
, mnHeight( -1 ) , mnHeight( -1 )
, mnDepth( 0 ) , mnDepth( 0 )
...@@ -22,6 +23,7 @@ X11Pixmap::X11Pixmap() ...@@ -22,6 +23,7 @@ X11Pixmap::X11Pixmap()
X11Pixmap::X11Pixmap( Display* pDisplay, SalX11Screen nScreen, int nWidth, int nHeight, int nDepth ) X11Pixmap::X11Pixmap( Display* pDisplay, SalX11Screen nScreen, int nWidth, int nHeight, int nDepth )
: mpDisplay( pDisplay ) : mpDisplay( pDisplay )
, mnScreen( nScreen ) , mnScreen( nScreen )
, mbDeletePixmap( true )
, mnWidth( nWidth ) , mnWidth( nWidth )
, mnHeight( nHeight ) , mnHeight( nHeight )
, mnDepth( nDepth ) , mnDepth( nDepth )
...@@ -33,17 +35,19 @@ X11Pixmap::X11Pixmap( Display* pDisplay, SalX11Screen nScreen, int nWidth, int n ...@@ -33,17 +35,19 @@ X11Pixmap::X11Pixmap( Display* pDisplay, SalX11Screen nScreen, int nWidth, int n
X11Pixmap::X11Pixmap( X11Pixmap& rOther ) X11Pixmap::X11Pixmap( X11Pixmap& rOther )
: mpDisplay( rOther.mpDisplay ) : mpDisplay( rOther.mpDisplay )
, mnScreen( rOther.mnScreen ) , mnScreen( rOther.mnScreen )
, mbDeletePixmap( rOther.mbDeletePixmap )
, mnWidth( rOther.mnWidth ) , mnWidth( rOther.mnWidth )
, mnHeight( rOther.mnHeight ) , mnHeight( rOther.mnHeight )
, mnDepth( rOther.mnDepth ) , mnDepth( rOther.mnDepth )
{ {
mpPixmap = rOther.mpPixmap; mpPixmap = rOther.mpPixmap;
rOther.mpPixmap = 0; rOther.mpPixmap = 0;
rOther.mbDeletePixmap = false;
} }
X11Pixmap::~X11Pixmap() X11Pixmap::~X11Pixmap()
{ {
if( mpPixmap ) if (mbDeletePixmap && mpPixmap)
XFreePixmap( mpDisplay, mpPixmap ); XFreePixmap( mpDisplay, mpPixmap );
} }
......
...@@ -290,7 +290,7 @@ GdkX11Pixmap::GdkX11Pixmap( int nWidth, int nHeight, int nDepth ) ...@@ -290,7 +290,7 @@ GdkX11Pixmap::GdkX11Pixmap( int nWidth, int nHeight, int nDepth )
} }
GdkX11Pixmap::GdkX11Pixmap( X11Pixmap& rOther, GdkWindow *pWindow ) GdkX11Pixmap::GdkX11Pixmap( X11Pixmap& rOther, GdkWindow *pWindow )
: X11Pixmap( rOther ) : X11Pixmap(rOther)
{ {
GdkColormap* pColormap; 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