Tk Source Code

Check-in [37ab4932]
Login

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

Overview
Comment:Fix [a67252b384]: Memory leak when running the revised_text test suite
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256: 37ab4932858f49ec6260f04a7ac460d55b4ec4a0df80b7de5ece19be689ac1b1
User & Date: fvogel 2024-12-14 11:33:51
References
2024-12-14
11:36 Ticket [a67252b3] Memory leak when running the revised_text test suite status still Open with 4 other changes artifact: b3235e54 user: fvogel
Context
2024-12-22
13:44
Merge 9.0 check-in: 810d4730 user: jan.nijtmans tags: revised_text, tip-466
2024-12-14
11:33
Fix [a67252b384]: Memory leak when running the revised_text test suite check-in: 37ab4932 user: fvogel tags: revised_text, tip-466
2024-12-12
20:18
merge trunk check-in: 758d9de6 user: fvogel tags: revised_text, tip-466
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/tkTextDisp.c.
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
	     * Refcount gymnastics here to prevent the resource from being released
	     * in case the displayProc destroys the widget.
	     */

	    textPtr->refCount += 1;
	    chunkPtr->layoutProcs->displayProc(textPtr, chunkPtr, x, yBase, height,
		    baseline, display, pixmap, screenY);
	    textPtr->refCount -= 1;

	    if (TkTextReleaseIfDestroyed(textPtr)) {
		/*
		 * The displayProc invoked a binding that caused the widget
		 * to be deleted. Don't do anything.
		 */
		return;
	    }








<
<
|







6393
6394
6395
6396
6397
6398
6399


6400
6401
6402
6403
6404
6405
6406
6407
	     * Refcount gymnastics here to prevent the resource from being released
	     * in case the displayProc destroys the widget.
	     */

	    textPtr->refCount += 1;
	    chunkPtr->layoutProcs->displayProc(textPtr, chunkPtr, x, yBase, height,
		    baseline, display, pixmap, screenY);


	    if (TkTextDecrRefCountAndTestIfDestroyed(textPtr)) {
		/*
		 * The displayProc invoked a binding that caused the widget
		 * to be deleted. Don't do anything.
		 */
		return;
	    }

8855
8856
8857
8858
8859
8860
8861

8862
8863

8864
8865
8866
8867
8868
8869
8870
	    if ((dlPtr->flags & OLD_Y_INVALID) || dlPtr->oldY != dlPtr->y) {
		if (tkTextDebug) {
		    char string[TK_POS_CHARS];

		    TkrTextPrintIndex(textPtr, &dlPtr->index, string);
		    LOG("tk_textRedraw", string);
		}

		DisplayDLine(textPtr, dlPtr, dlPtr->prevPtr, pixmap);
		if ((textPtr->tkwin == NULL) || (textPtr->flags & DESTROYED)) {

		    /*
		     * DisplayDLine called a displayProc which invoked a binding
		     * that caused the widget to be deleted. Don't do anything.
		     */
		    goto end;
		}
		if (dInfoPtr->dLinesInvalidated) {







>

<
>







8853
8854
8855
8856
8857
8858
8859
8860
8861

8862
8863
8864
8865
8866
8867
8868
8869
	    if ((dlPtr->flags & OLD_Y_INVALID) || dlPtr->oldY != dlPtr->y) {
		if (tkTextDebug) {
		    char string[TK_POS_CHARS];

		    TkrTextPrintIndex(textPtr, &dlPtr->index, string);
		    LOG("tk_textRedraw", string);
		}
		textPtr->refCount += 1;
		DisplayDLine(textPtr, dlPtr, dlPtr->prevPtr, pixmap);

		if (TkTextDecrRefCountAndTestIfDestroyed(textPtr)) {
		    /*
		     * DisplayDLine called a displayProc which invoked a binding
		     * that caused the widget to be deleted. Don't do anything.
		     */
		    goto end;
		}
		if (dInfoPtr->dLinesInvalidated) {