summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2006-10-17 13:01:51 +0000
committerOliver Bolte <obo@openoffice.org>2006-10-17 13:01:51 +0000
commitf8e0e278faf55f03b47b2b01e35f64543053a89a (patch)
treeab4bf9ccfdf87c98702e591198fdae243cad9cc2 /vcl
parentnew version for SRC680 (diff)
downloadcore-f8e0e278faf55f03b47b2b01e35f64543053a89a.tar.gz
core-f8e0e278faf55f03b47b2b01e35f64543053a89a.zip
#i70487# fix duplicate delete
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/source/app/saldisp.cxx18
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 );
}
}