Fix [7da6c2d04c]: fileevent poor performance due to shimmering

This commit is contained in:
jan.nijtmans
2026-05-27 10:35:15 +00:00
parent ac38cf507c
commit ae67ea5ede
2 changed files with 8 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ to the userbase.
- [Building sqlite3 for tcl8 redefines typedef](https://core.tcl-lang.org/tcl/info/ad08bc)
- [Inconsistent file join with volume-relative arguments](https://core.tcl-lang.org/tcl/info/1215dc)
- [mind PTHREAD_NULL as sentinel value vs legitimate pthread_t arg](https://core.tcl-lang.org/tcl/info/673f2d)
- [fileevent poor performance due to shimmering](https://core.tcl-lang.org/tcl/info/7da6c2)
# Updated bundled packages, libraries, standards, data
- autoconf 2.73

View File

@@ -9238,6 +9238,7 @@ Tcl_FileEventObjCmd(
const char *chanName;
int modeIndex; /* Index of mode argument. */
int mask;
Tcl_Size length; /* llength of callback script */
static const char *const modeOptions[] = {"readable", "writable", NULL};
static const int maskArray[] = {TCL_READABLE, TCL_WRITABLE};
@@ -9285,7 +9286,12 @@ Tcl_FileEventObjCmd(
* If we are supposed to delete a stored script, do so.
*/
if (*(TclGetString(objv[3])) == '\0') {
if ((objv[3]->bytes == NULL) && TclObjTypeHasProc(objv[3], lengthProc)) {
length = TclObjTypeLength(objv[3]);
} else {
TclGetStringFromObj(objv[3], &length);
}
if (0 == length) {
DeleteScriptRecord(interp, chanPtr, mask);
return TCL_OK;
}