diff options
| author | nyamatongwe <devnull@localhost> | 2002-02-03 01:02:22 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2002-02-03 01:02:22 +0000 | 
| commit | 080ff4532e6ad7a2e74bc3913096b6ee25437a02 (patch) | |
| tree | 13a6af966216ecbd30a7eaf8b1a18d78979f90c7 /src/ContractionState.cxx | |
| parent | a9564dd2354f3d80c18a938c68589f5a62ff1a35 (diff) | |
| download | scintilla-mirror-080ff4532e6ad7a2e74bc3913096b6ee25437a02.tar.gz | |
When changing document, ensured rewrap performed.
Made memory allocation a little safer in ContractionState.
Diffstat (limited to 'src/ContractionState.cxx')
| -rw-r--r-- | src/ContractionState.cxx | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/src/ContractionState.cxx b/src/ContractionState.cxx index 3d2dde3c6..aadf98ed9 100644 --- a/src/ContractionState.cxx +++ b/src/ContractionState.cxx @@ -44,12 +44,14 @@ void ContractionState::MakeValid() const {  		}  		if (sizeDocLines < linesInDisplay) {  			delete []docLines; -			docLines = new int[linesInDisplay + growSize]; -			if (docLines) { -				sizeDocLines = linesInDisplay + growSize; -			} else { +			int *docLinesNew = new int[linesInDisplay + growSize]; +			if (!docLinesNew) { +				docLines = 0; +				sizeDocLines = 0;  				return;  			} +			docLines = docLinesNew; +			sizeDocLines = linesInDisplay + growSize;  		}  		int lineInDisplay=0; | 
