From 0722f6fc65d9a2064209185f64f28c63a37f303d Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Tue, 28 Sep 2004 15:44:35 +0000 Subject: [PATCH] Synchronize the "getType" method of "CVariable.InternalVariable". --- debug/org.eclipse.cdt.debug.core/ChangeLog | 4 ++++ .../debug/internal/core/model/CVariable.java | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 331a228766d..456ccbba91a 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,7 @@ +2004-09-28 Mikhail Khodjaiants + Synchronize the "getType" method of "CVariable.InternalVariable". + * CVariable.java + 2004-09-27 Mikhail Khodjaiants Use the new "getValue" method of "IAddress" for address comparison. * Disassembly.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java index 9ce25284852..bba9778626e 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java @@ -152,13 +152,18 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener { CType getType() throws DebugException { if ( fType == null ) { ICDIVariableObject varObject = getCDIVariableObject(); - if ( varObject != null ) - try { - fType = new CType( varObject.getType() ); - } - catch( CDIException e ) { - requestFailed( e.getMessage(), null ); + if ( varObject != null ) { + synchronized( this ) { + if ( fType == null ) { + try { + fType = new CType( varObject.getType() ); + } + catch( CDIException e ) { + requestFailed( e.getMessage(), null ); + } + } } + } } return fType; }