diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-10-17 13:01:51 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-10-17 13:01:51 +0000 |
commit | f8e0e278faf55f03b47b2b01e35f64543053a89a (patch) | |
tree | ab4bf9ccfdf87c98702e591198fdae243cad9cc2 /vcl/unx | |
parent | 92e17b4e4fa77e17420ce1226eed55515837e851 (diff) |
#i70487# fix duplicate delete
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/source/app/saldisp.cxx | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx index f9ae621c74a5..b4e7dc28c109 100644 --- a/vcl/unx/source/app/saldisp.cxx +++ b/vcl/unx/source/app/saldisp.cxx @@ -4,9 +4,9 @@ * * $RCSfile: saldisp.cxx,v $ * - * $Revision: 1.83 $ + * $Revision: 1.84 $ * - * last change: $Author: obo $ $Date: 2006-10-11 08:21:45 $ + * last change: $Author: obo $ $Date: 2006-10-17 14:01:51 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -3192,8 +3192,8 @@ SalColormap::SalColormap( USHORT nDepth ) &aVI ) ) { aVI.visual = new Visual(); - aVI.visualid = (VisualID)-1; - aVI.screen = -1; + aVI.visualid = (VisualID)0; // beware of temporary destructor below + aVI.screen = 0; aVI.depth = nDepth; aVI.c_class = TrueColor; if( 24 == nDepth ) // 888 @@ -3243,9 +3243,15 @@ SalColormap::SalColormap( USHORT nDepth ) aVI.visual->blue_mask = aVI.blue_mask; aVI.visual->bits_per_rgb = aVI.bits_per_rgb; aVI.visual->map_entries = aVI.colormap_size; - } - m_aVisual = SalVisual( &aVI ); + m_aVisual = SalVisual( &aVI ); + // give ownership of constructed Visual() to m_aVisual + // see SalVisual destructor + m_aVisual.visualid = (VisualID)-1; + m_aVisual.screen = -1; + } + else + m_aVisual = SalVisual( &aVI ); } } |