diff options
author | jan.nijtmans <jan.nijtmans@noemail.net> | 2016-02-08 15:52:53 (GMT) |
---|---|---|
committer | jan.nijtmans <jan.nijtmans@noemail.net> | 2016-02-08 15:52:53 (GMT) |
commit | 0f7957679f6478a99115caa15879781f53f018a2 (patch) | |
tree | d5be70b19e023e63879342819ad51865ebe26fd1 /generic | |
parent | 60b5ceeceea4192942e3bdfdb8fc5b0d64bf9caa (diff) | |
download | tk-0f7957679f6478a99115caa15879781f53f018a2.zip tk-0f7957679f6478a99115caa15879781f53f018a2.tar.gz tk-0f7957679f6478a99115caa15879781f53f018a2.tar.bz2 |
(cherry-pick): Fix [06c14339060ba9ae]: Text widget crash during delete. Thanks to François Vogel for the implementation and Brian Griffing for all his help getting this figured out.
FossilOrigin-Name: 36aed7e3e96626e0b3be4be8c90f3eaff61262f3
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkTextDisp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 10f6414..91642f9 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -4683,6 +4683,9 @@ TextChanged( */ lastPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &rounded); + while ((lastPtr != NULL) && (TkTextIndexCmp(&lastPtr->index, &rounded) < 0)) { + lastPtr = lastPtr->nextPtr; + } /* * At least one display line is supposed to change. This makes the @@ -4699,11 +4702,6 @@ TextChanged( } } - while ((lastPtr != NULL) - && (lastPtr->index.linePtr == index2Ptr->linePtr)) { - lastPtr = lastPtr->nextPtr; - } - /* * Delete all the DLines from firstPtr up to but not including lastPtr. */ |