Re: Error shutting down TCL
- From: Mark Janssen <mpc.janssen@xxxxxxxxx>
- Date: 31 May 2007 06:00:14 -0700
On May 31, 2:28 pm, bluemoosek...@xxxxxxxxx wrote:
Hi,
I'm having some trouble shutting down TCL embedded in a DLL (on
WinXP). The function below blows up on the second printf. For some
reason after calling Tcl_Finalize, I always get the error "Library
function error(return value == -1 {0xffffffff}). Bad File Handle
If I comment out the printf... I still get the same error on the very
next printf I encounter
int __stdcall ShutDown(void) {
int ret;
ret = printf ("Deleting instance of TCL Interpreter\n");
Tcl_DeleteInterp(myInterpreter);
Tcl_Finalize();
ret = printf("Unloading TCL Library: %#X\n", hTCLModule);
FreeLibrary(hTCLModule);
return 0;
}
Jon
One of the things Tcl_Finalize does is closing open channels
(including stdin and stdout) This means that after a call to
Tcl_Finalize these channels are not available anymore and therefore a
printf will fail.
You could move the printf line to above the Tcl_Finalize.
Mark
.
- References:
- Error shutting down TCL
- From: bluemooseking
- Error shutting down TCL
- Prev by Date: Re: Button info
- Next by Date: Re: Seeking a rich text editing widget
- Previous by thread: Error shutting down TCL
- Index(es):