1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00

bug 205393: [terminal] terminal causes stack overflow

https://bugs.eclipse.org/bugs/show_bug.cgi?id=205393
This commit is contained in:
Michael Scharf 2007-10-04 17:51:44 +00:00
parent a6bab8287c
commit a4699ff8ef

View file

@ -35,6 +35,10 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
private ITerminalTextDataSnapshot fSelectionSnapshot; private ITerminalTextDataSnapshot fSelectionSnapshot;
private String fCurrentSelection=""; //$NON-NLS-1$ private String fCurrentSelection=""; //$NON-NLS-1$
private final Point fSelectionAnchor=new Point(0,0); private final Point fSelectionAnchor=new Point(0,0);
/**
* do not update while update is running
*/
boolean fInUpdate;
public AbstractTextCanvasModel(ITerminalTextDataSnapshot snapshot) { public AbstractTextCanvasModel(ITerminalTextDataSnapshot snapshot) {
fSnapshot=snapshot; fSnapshot=snapshot;
@ -75,7 +79,9 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
return fSnapshot; return fSnapshot;
} }
protected void updateSnapshot() { protected void updateSnapshot() {
if(fSnapshot.isOutOfDate()) { if(!fInUpdate && fSnapshot.isOutOfDate()) {
fInUpdate=true;
try {
fSnapshot.updateSnapshot(false); fSnapshot.updateSnapshot(false);
if(fSnapshot.hasTerminalChanged()) if(fSnapshot.hasTerminalChanged())
fireTerminalDataChanged(); fireTerminalDataChanged();
@ -92,6 +98,10 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
int height=fSnapshot.getLastChangedLine()-y+1; int height=fSnapshot.getLastChangedLine()-y+1;
fireCellRangeChanged(0, y, fSnapshot.getWidth(), height); fireCellRangeChanged(0, y, fSnapshot.getWidth(), height);
} }
} finally {
fInUpdate=false;
}
} }
} }
/** /**