Tk Source Code

Check-in [a70c2a08]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaert
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: a70c2a08f11a822101169f14429d259da8adc333
User & Date: fvogel 2015-12-13 19:53:23
Context
2015-12-15
02:53
Fix for some redraw issues on Tk-Cocoa on OS X 10.11; further refinement of memory management; thanks to Marc Culler for patches check-in: c276c0a9 user: kevin_walzer tags: core-8-5-branch
2015-12-13
20:10
Merged core-8-5-branch check-in: 5a61887f user: fvogel tags: tip-438
20:02
Fixed bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaert check-in: 4ea4a0b1 user: fvogel tags: trunk
19:53
Fixed bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaert check-in: a70c2a08 user: fvogel tags: core-8-5-branch
2015-12-12
17:35
Fix for bug [1739605] - [text see] misbehaves following widget create/populate - Patch from Koen Danckaert check-in: a4bf73e4 user: fvogel tags: core-8-5-branch
2015-12-07
21:36
Better patch for bug [ff8a1e55a2] - Filling a never-mapped text widget is CPU hungry - Patch from Koen Danckaert Closed-Leaf check-in: 0b7b34f4 user: fvogel tags: bug-ff8a1e55a2
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkTextDisp.c.

654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
....
2908
2909
2910
2911
2912
2913
2914
2915

2916
2917
2918
2919
2920
2921
2922
2923
2924
    dInfoPtr->newTopPixelOffset = 0;
    dInfoPtr->currentMetricUpdateLine = -1;
    dInfoPtr->lastMetricUpdateLine = -1;
    dInfoPtr->lineMetricUpdateEpoch = 1;
    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);

    textPtr->dInfoPtr = dInfoPtr;
}
 
/*
 *----------------------------------------------------------------------
 *
................................................................................
{
    register TkText *textPtr = (TkText *) clientData;
    TextDInfo *dInfoPtr = textPtr->dInfoPtr;
    int lineNum;

    dInfoPtr->lineUpdateTimer = NULL;

    if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {

	/*
	 * The widget has been deleted. Don't do anything.
	 */

	if (--textPtr->refCount == 0) {
	    ckfree((char *) textPtr);
	}
	return;
    }






<
<
<
<
<
<
|
<
<
|
<







 







|
>

|







654
655
656
657
658
659
660






661


662

663
664
665
666
667
668
669
....
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
    dInfoPtr->newTopPixelOffset = 0;
    dInfoPtr->currentMetricUpdateLine = -1;
    dInfoPtr->lastMetricUpdateLine = -1;
    dInfoPtr->lineMetricUpdateEpoch = 1;
    dInfoPtr->metricEpoch = -1;
    dInfoPtr->metricIndex.textPtr = NULL;
    dInfoPtr->metricIndex.linePtr = NULL;






    dInfoPtr->lineUpdateTimer = NULL;


    dInfoPtr->scrollbarTimer = NULL;


    textPtr->dInfoPtr = dInfoPtr;
}
 
/*
 *----------------------------------------------------------------------
 *
................................................................................
{
    register TkText *textPtr = (TkText *) clientData;
    TextDInfo *dInfoPtr = textPtr->dInfoPtr;
    int lineNum;

    dInfoPtr->lineUpdateTimer = NULL;

    if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)
            || !Tk_IsMapped(textPtr->tkwin)) {
	/*
	 * The widget has been deleted, or is not mapped. Don't do anything.
	 */

	if (--textPtr->refCount == 0) {
	    ckfree((char *) textPtr);
	}
	return;
    }