summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-08 15:51:40 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-08 15:51:40 (GMT)
commit9425cf81e4e73cf2c80e940a811967e58abdc054 (patch)
tree215d70b3039a5a2ef35b0b821ac407d8fe874cc8 /generic
parent4b766d1f24378289437bc45e7405f68a48053915 (diff)
parentecb4e238565152c913a65d2eb5d8ad782793b474 (diff)
downloadtk-9425cf81e4e73cf2c80e940a811967e58abdc054.zip
tk-9425cf81e4e73cf2c80e940a811967e58abdc054.tar.gz
tk-9425cf81e4e73cf2c80e940a811967e58abdc054.tar.bz2
Fix [06c14339060ba9ae]: Text widget crash during delete. Thanks to François Vogel for the implementation and Brian Griffin for all his help getting this figured out.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextDisp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index f2e760b..07623c4 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -4749,6 +4749,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
@@ -4765,11 +4768,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.
*/