summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-12-13 20:02:24 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-12-13 20:02:24 (GMT)
commit3f1055f6005a1124d104b5c8c94e3f83e3604723 (patch)
tree6d1f8ea8c5609d3dff3958c35c4bbe1521830b1a
parent72dde23165afa96dcc2cc50263394cefafe8e403 (diff)
parent47c6cf375321a9f00b0446e3753d6f9d8c357cd8 (diff)
downloadtk-3f1055f6005a1124d104b5c8c94e3f83e3604723.zip
tk-3f1055f6005a1124d104b5c8c94e3f83e3604723.tar.gz
tk-3f1055f6005a1124d104b5c8c94e3f83e3604723.tar.bz2
Fixed bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaert
-rw-r--r--generic/tkTextDisp.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 86a81c0..eb479b2 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -659,17 +659,8 @@ TkTextCreateDInfo(
dInfoPtr->metricEpoch = -1;
dInfoPtr->metricIndex.textPtr = NULL;
dInfoPtr->metricIndex.linePtr = NULL;
-
- /*
- * Add a refCount for each of the idle call-backs.
- */
-
- textPtr->refCount++;
- dInfoPtr->lineUpdateTimer = Tcl_CreateTimerHandler(0,
- AsyncUpdateLineMetrics, textPtr);
- textPtr->refCount++;
- dInfoPtr->scrollbarTimer = Tcl_CreateTimerHandler(200,
- AsyncUpdateYScrollbar, textPtr);
+ dInfoPtr->lineUpdateTimer = NULL;
+ dInfoPtr->scrollbarTimer = NULL;
textPtr->dInfoPtr = dInfoPtr;
}
@@ -2913,9 +2904,10 @@ AsyncUpdateLineMetrics(
dInfoPtr->lineUpdateTimer = NULL;
- if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {
+ if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)
+ || !Tk_IsMapped(textPtr->tkwin)) {
/*
- * The widget has been deleted. Don't do anything.
+ * The widget has been deleted, or is not mapped. Don't do anything.
*/
if (--textPtr->refCount == 0) {