Description: |
Ever since the initialization of the -undo widget option has been set to TK_OPTION_DONT_SET_DEFAULT the -undo option has been initialized to 1 with the consequence of huge memory leakage with the Windows console implemented as a Text widget. The problem is seen by
console eval {.console configure -undo}
which shows the -undo is wrongfully set to 1.
The fix is a one-liner - patch generic/tkText.c around line 550:
RCS file: /usr/cvsroot/tk8.6/generic/tkText.c,v
retrieving revision 1.2
retrieving revision 1.4
diff -c -3 -r1.2 -r1.4
*** tkText.c 25 Jul 2017 18:34:34 -0000 1.2
--- tkText.c 2 Aug 2017 15:02:49 -0000 1.4
***************
*** 547,553 ****
Tcl_InitHashTable(&sharedPtr->windowTable, TCL_STRING_KEYS);
Tcl_InitHashTable(&sharedPtr->imageTable, TCL_STRING_KEYS);
sharedPtr->undoStack = TkUndoInitStack(interp,0);
! sharedPtr->undo = 1;
sharedPtr->isDirty = 0;
sharedPtr->dirtyMode = TK_TEXT_DIRTY_NORMAL;
sharedPtr->autoSeparators = 1;
--- 547,553 ----
Tcl_InitHashTable(&sharedPtr->windowTable, TCL_STRING_KEYS);
Tcl_InitHashTable(&sharedPtr->imageTable, TCL_STRING_KEYS);
sharedPtr->undoStack = TkUndoInitStack(interp,0);
! sharedPtr->undo = atoi(DEF_TEXT_UNDO);
sharedPtr->isDirty = 0;
sharedPtr->dirtyMode = TK_TEXT_DIRTY_NORMAL;
sharedPtr->autoSeparators = 1;
|