[Libreoffice-commits] core.git: vcl/inc vcl/unx
Caolán McNamara
caolanm at redhat.com
Mon Nov 10 12:35:19 PST 2014
vcl/inc/unx/pixmap.hxx | 1 +
vcl/unx/generic/gdi/pixmap.cxx | 6 +++++-
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit cee950b53bc8e0e2d8d494376c9f1331f8ce8e45
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Nov 10 20:32:49 2014 +0000
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
diff --git a/vcl/inc/unx/pixmap.hxx b/vcl/inc/unx/pixmap.hxx
index 40bc11f..b65170f 100644
--- a/vcl/inc/unx/pixmap.hxx
+++ b/vcl/inc/unx/pixmap.hxx
@@ -36,6 +36,7 @@ protected:
Display* mpDisplay;
SalX11Screen mnScreen;
Pixmap mpPixmap;
+ bool mbDeletePixmap;
int mnWidth;
int mnHeight;
int mnDepth;
diff --git a/vcl/unx/generic/gdi/pixmap.cxx b/vcl/unx/generic/gdi/pixmap.cxx
index c30b9af..0440c46 100644
--- a/vcl/unx/generic/gdi/pixmap.cxx
+++ b/vcl/unx/generic/gdi/pixmap.cxx
@@ -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 );
}
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index b8db643..0cf68fd 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -290,7 +290,7 @@ GdkX11Pixmap::GdkX11Pixmap( int nWidth, int nHeight, int nDepth )
}
GdkX11Pixmap::GdkX11Pixmap( X11Pixmap& rOther, GdkWindow *pWindow )
-: X11Pixmap( rOther )
+ : X11Pixmap(rOther)
{
GdkColormap* pColormap;
More information about the Libreoffice-commits
mailing list