Artifacts Associated With Ticket 458490ffffffffff
Ticket change [40e62e6858] (rid 116088) by crokusek on 2001-09-04 19:08:47:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Hi All, I create an interpreter from "C" evaluate the following script: set F [open $rep_file w] puts invalid_file_ptr this_causes_an_error close $F Because an error occurs in the "puts" the "close $F" does not get called during script evaluation. Opening the file up with Wordpad gives the "File in use by another application." Note that win-emacs can open the file so it is a windows open exclusive type open that gives the error. After reporting the error, the "C" then code deletes the interpreter but still the file handle must be open because Wordpad still cannot open. I have also tried calling this directly before and after deleting the Interpreter: Tcl_DeleteAssocData(gpInterp, "tclIO"); But it has no effect either. :(. I have verified this bug to exist in 8.0 8.3 and 8.4 Can anyone provide workaround. Do I have to trap "open's" and "close's" myself? Note that replacing the illegal "puts" statement with a "return" actually has the same effect. Of course exiting the process closes the handle and wordpad is able to open the file. Thanks, Chris
- foundin initialized to: "obsolete: 8.4a4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "crokusek"
- subsystem initialized to: "24. Channel Commands"
- title initialized to: "Leaking Open File Handles"
- type initialized to: "Bug"
Ticket change [257a61e339] (rid 88181) by crokusek on 2001-09-05 04:17:31:
- icomment:
Logged In: YES user_id=315927 The script should read: set F [open $rep_file w] puts invalid_file_ptr this_causes_an_error close $F OR set F [open $rep_file w] return close $F
- login: "crokusek"
- mimetype: "text/plain"
- username: "crokusek"
- icomment:
Ticket change [93e30ee944] (rid 105879) by hobbs on 2001-09-05 04:32:33:
- closedate changed to: "2001-09-04T21:32:33"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 You can't just init and delete the single interp (channels can be moved between interps and threads). You need to make sure Tcl_Finalize is called (which in turn calls TclFinalizeIOSubsystem which actually ensures all channels are closed).
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "hobbs"