Overview
| Artifact ID: | 7700f8e260fcd50bb5a3720ddfc70b0fc450c4a3 |
|---|---|
| Ticket: | 733126ffffffffffffffffffffffffffffffffff
Memory leak while creating and deleting interpreters |
| User & Date: | kdina2001 on 2003-05-06 22:53:47 |
Changes
- icomment:
Logged In: YES user_id=772890 I tested with the latest version as well. That is 8.3.5. The issue seems to be present in this version as well. I was able to fix this by doing something as follows. But am not sure if that affects anything else. Can you please let me know if there is a better fix available ? File : unix/tclUnixChan.c : ================== static int FileCloseProc(instanceData, interp) ClientData instanceData;/* File state. */ Tcl_Interp *interp;/* For error reporting - unused. */ { FileState *fsPtr = (FileState *) instanceData; FileState **nextPtrPtr; int errorCode = 0; ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); [ -- snip -- ] for (nextPtrPtr = &(tsdPtr->firstFilePtr); (*nextPtrPtr) != NULL; nextPtrPtr = &((*nextPtrPtr)->nextPtr)) { if ((*nextPtrPtr) == fsPtr) { (*nextPtrPtr) = fsPtr->nextPtr; break; } } ckfree((char *) fsPtr); /*Added the following to free the allocation made for tsd*/ if(tsdPtr->firstFilePtr == NULL){ /* List is empty, free the head */ ckfree( tsdPtr ); } return errorCode; } - login: "kdina2001"
- mimetype: "text/plain"
- username: "kdina2001"