Index: generic/tkError.c ================================================================== --- generic/tkError.c +++ generic/tkError.c @@ -163,10 +163,17 @@ * reduces the overhead of scanning the list to clean up (particularly if * there are many handlers that stay around forever). */ dispPtr->deleteCount += 1; + + /* + * Ensure that no user callback for this handler is invoked any further. + */ + + errorPtr->errorProc = NULL; + if (dispPtr->deleteCount >= 10) { TkErrorHandler *prevPtr; TkErrorHandler *nextPtr; int lastSerial = LastKnownRequestProcessed(dispPtr->display); Index: unix/tkUnixRFont.c ================================================================== --- unix/tkUnixRFont.c +++ unix/tkUnixRFont.c @@ -776,11 +776,12 @@ if (!errorFlag) { LOCK; XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents); UNLOCK; - } else { + } + if (errorFlag) { extents.xOff = 0; errorFlag = 0; } newX = curX + extents.xOff;