diff options
| author | dgp <dgp@users.sourceforge.net> | 2016-03-28 21:24:22 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2016-03-28 21:24:22 (GMT) |
| commit | f816bb2a60b95431aff01e3f048b3da7353323f9 (patch) | |
| tree | 450c7ea2350bd2ac42208d372730066b2f0317bf | |
| parent | e79059759a4180161a230472ce2acc7a00d29269 (diff) | |
| download | tcl-f816bb2a60b95431aff01e3f048b3da7353323f9.zip tcl-f816bb2a60b95431aff01e3f048b3da7353323f9.tar.gz tcl-f816bb2a60b95431aff01e3f048b3da7353323f9.tar.bz2 | |
The DupEncodingIntRep() routine is broken. It fails to set the typePtr
field of the duplicated Tcl_Obj to indicate that the intrep is that of
the &encodingType. The impact must be that refcounting of Tcl_Encodings
are out of balance, at least in the (unusual?) case where "encoding" values
need duplication. I hesitate to actually commit this fix until I have a
test demonstrating the need for it, and a chance to see the impact on
actual encoding operations. The lifetime management of encodings has a
history of being tricky and raising controversy. More work required.
| -rw-r--r-- | generic/tclEncoding.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 4edebcf..32055a3 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -355,6 +355,7 @@ DupEncodingIntRep( Tcl_Obj *dupPtr) { dupPtr->internalRep.twoPtrValue.ptr1 = Tcl_GetEncoding(NULL, srcPtr->bytes); + dupPtr->typePtr = &encodingType; } /* |
