summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2015-12-13 19:53:23 (GMT)
committerfvogelnew1@free.fr <fvogel>2015-12-13 19:53:23 (GMT)
commitbb0511348e9161341c9fe1986a5fac68bed62469 (patch)
treece44642ae8fcdb160f2c8049bcca93d4f8094948 /generic/tkTextDisp.c
parentdc537980621272ac6d2074337f871f12c8e281b0 (diff)
parent14ed76d192fa73bc1c430a3b1f3772989ab7fbef (diff)
downloadtk-bb0511348e9161341c9fe1986a5fac68bed62469.zip
tk-bb0511348e9161341c9fe1986a5fac68bed62469.tar.gz
tk-bb0511348e9161341c9fe1986a5fac68bed62469.tar.bz2
Fixed bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaert
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 851e17a..ef8d6f4 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -658,17 +658,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, (ClientData) textPtr);
- textPtr->refCount++;
- dInfoPtr->scrollbarTimer = Tcl_CreateTimerHandler(200,
- AsyncUpdateYScrollbar, (ClientData) textPtr);
+ dInfoPtr->lineUpdateTimer = NULL;
+ dInfoPtr->scrollbarTimer = NULL;
textPtr->dInfoPtr = dInfoPtr;
}
@@ -2912,9 +2903,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) {