summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-12-13 19:53:23 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-12-13 19:53:23 (GMT)
commit47c6cf375321a9f00b0446e3753d6f9d8c357cd8 (patch)
treece44642ae8fcdb160f2c8049bcca93d4f8094948
parent92c4176bdae17dbc3ab1d73817e155043caeb781 (diff)
parent7aa2342349dcaec45b76ecf2f5c6b0fe8ec33ae1 (diff)
downloadtk-47c6cf375321a9f00b0446e3753d6f9d8c357cd8.zip
tk-47c6cf375321a9f00b0446e3753d6f9d8c357cd8.tar.gz
tk-47c6cf375321a9f00b0446e3753d6f9d8c357cd8.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 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) {