diff options
author | fvogel <fvogelnew1@free.fr> | 2015-12-07 21:36:25 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-12-07 21:36:25 (GMT) |
commit | 7aa2342349dcaec45b76ecf2f5c6b0fe8ec33ae1 (patch) | |
tree | 3a23e3334804a0251d391e8b40f46861fe2227b5 /generic/tkTextDisp.c | |
parent | c1c79b52233b43b276d2b2933dade1563b16f0c5 (diff) | |
download | tk-7aa2342349dcaec45b76ecf2f5c6b0fe8ec33ae1.zip tk-7aa2342349dcaec45b76ecf2f5c6b0fe8ec33ae1.tar.gz tk-7aa2342349dcaec45b76ecf2f5c6b0fe8ec33ae1.tar.bz2 |
Better patch for bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaertbug_ff8a1e55a2
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r-- | generic/tkTextDisp.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index cfe6e7a..8a9d0e8 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) { |