Tk Source Code

Check-in [7a599109]
Login

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

Overview
Comment:Fix [f52986c698]: SIGABRT from Tk_DeleteErrorHandler()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-branch
Files: files | file ages | folders
SHA3-256: 7a599109d4fc8ea5cdfec926e2bb22e45d0ac3bf0948ef9dd8550739899356a2
User & Date: jan.nijtmans 2024-10-11 09:47:14.691
References
2024-10-11
10:11 Closed ticket [f52986c6]: SIGABRT from Tk_DeleteErrorHandler() plus 6 other changes artifact: ded8be27 user: jan.nijtmans
Context
2024-10-11
10:56
Improved the appearance of the ttk::checkbutton widget in the "default" theme. check-in: 617a4fca user: csaba tags: core-8-branch
10:09
Fix [f52986c698]: SIGABRT from Tk_DeleteErrorHandler() check-in: 1602306b user: jan.nijtmans tags: trunk, main
09:47
Fix [f52986c698]: SIGABRT from Tk_DeleteErrorHandler() check-in: 7a599109 user: jan.nijtmans tags: core-8-branch
09:41
Fix [f52986c698]: SIGABRT from Tk_DeleteErrorHandler(). Backport some code cleanup from Tk 9.0 check-in: 9a633930 user: jan.nijtmans tags: core-8-6-branch
2024-10-10
21:13
Merge 8.6 check-in: 62a5d4ad user: jan.nijtmans tags: core-8-branch
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/tkError.c.
159
160
161
162
163
164
165


166
167
168
169
170
171
172
     * there may be previously-deleted handlers that are now ready for garbage
     * collection. To reduce the cost of the cleanup, let a few dead handlers
     * pile up, then clean them all at once. This adds a bit of overhead to
     * errors that might occur while the dead handlers are hanging around, but
     * reduces the overhead of scanning the list to clean up (particularly if
     * there are many handlers that stay around forever).
     */



    if (dispPtr->deleteCount++ >= 9) {
	TkErrorHandler *prevPtr;
	TkErrorHandler *nextPtr;
	unsigned long lastSerial = LastKnownRequestProcessed(dispPtr->display);

	/*







>
>







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
     * there may be previously-deleted handlers that are now ready for garbage
     * collection. To reduce the cost of the cleanup, let a few dead handlers
     * pile up, then clean them all at once. This adds a bit of overhead to
     * errors that might occur while the dead handlers are hanging around, but
     * reduces the overhead of scanning the list to clean up (particularly if
     * there are many handlers that stay around forever).
     */

    errorPtr->errorProc = NULL;

    if (dispPtr->deleteCount++ >= 9) {
	TkErrorHandler *prevPtr;
	TkErrorHandler *nextPtr;
	unsigned long lastSerial = LastKnownRequestProcessed(dispPtr->display);

	/*
Changes to unix/tkUnixRFont.c.
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371

    /*
     * Fill in platform-specific fields of TkFont.
     */

    errorFlag = 0;
    handler = Tk_CreateErrorHandler(Tk_Display(tkwin),
		    -1, -1, -1, InitFontErrorProc, (void *) &errorFlag);
    ftFont = GetFont(fontPtr, 0, 0.0);
    if ((ftFont == NULL) || errorFlag) {
	Tk_DeleteErrorHandler(handler);
	FinishedWithFont(fontPtr);
	ckfree(fontPtr);
	return NULL;
    }







|







357
358
359
360
361
362
363
364
365
366
367
368
369
370
371

    /*
     * Fill in platform-specific fields of TkFont.
     */

    errorFlag = 0;
    handler = Tk_CreateErrorHandler(Tk_Display(tkwin),
		    -1, -1, -1, InitFontErrorProc, (void *)&errorFlag);
    ftFont = GetFont(fontPtr, 0, 0.0);
    if ((ftFont == NULL) || errorFlag) {
	Tk_DeleteErrorHandler(handler);
	FinishedWithFont(fontPtr);
	ckfree(fontPtr);
	return NULL;
    }
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
     */

    {
	TkFont *fPtr = &fontPtr->font;

	fPtr->underlinePos = fPtr->fm.descent / 2;
	handler = Tk_CreateErrorHandler(Tk_Display(tkwin),
			-1, -1, -1, InitFontErrorProc, (void *) &errorFlag);
	errorFlag = 0;
	Tk_MeasureChars((Tk_Font) fPtr, "I", 1, -1, 0, &iWidth);
	Tk_DeleteErrorHandler(handler);
	if (errorFlag) {
	    FinishedWithFont(fontPtr);
	    ckfree(fontPtr);
	    return NULL;







|







399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
     */

    {
	TkFont *fPtr = &fontPtr->font;

	fPtr->underlinePos = fPtr->fm.descent / 2;
	handler = Tk_CreateErrorHandler(Tk_Display(tkwin),
			-1, -1, -1, InitFontErrorProc, (void *)&errorFlag);
	errorFlag = 0;
	Tk_MeasureChars((Tk_Font) fPtr, "I", 1, -1, 0, &iWidth);
	Tk_DeleteErrorHandler(handler);
	if (errorFlag) {
	    FinishedWithFont(fontPtr);
	    ckfree(fontPtr);
	    return NULL;
782
783
784
785
786
787
788
789


790
791
792
793
794
795
796
#endif /* DEBUG_FONTSEL */
	ftFont = GetFont(fontPtr, c, 0.0);

	if (!errorFlag) {
	    LOCK;
	    XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
	    UNLOCK;
	} else {


	    extents.xOff = 0;
	    errorFlag = 0;
	}

	newX = curX + extents.xOff;
	newByte = curByte + clen;
	if (maxLength >= 0 && newX > maxLength) {







<
>
>







782
783
784
785
786
787
788

789
790
791
792
793
794
795
796
797
#endif /* DEBUG_FONTSEL */
	ftFont = GetFont(fontPtr, c, 0.0);

	if (!errorFlag) {
	    LOCK;
	    XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
	    UNLOCK;

	}
	if (errorFlag) {
	    extents.xOff = 0;
	    errorFlag = 0;
	}

	newX = curX + extents.xOff;
	newByte = curByte + clen;
	if (maxLength >= 0 && newX > maxLength) {