Overview
| Artifact ID: | 1cb693254d0c78f1eddbf4f2f6238aa0007e7122 |
|---|---|
| Ticket: | 604609ffffffffffffffffffffffffffffffffff
leak in command rename traces |
| User & Date: | hemanglavana on 2002-09-06 04:15:04 |
Changes
- icomment:
Logged In: YES user_id=81875 Okay, here's a combined patch to fix both the memory leaks. Hemang. Index: tclBasic.c ============================================= ====================== RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v retrieving revision 1.69 diff -r1.69 tclBasic.c 2003a2004,2010 > /* > * Script for rename traces can delete the command "oldName". > * Therefore increment the reference count for cmdPtr so that > * it's Command structure is freed only towards the end of this > * function by calling TclCleanupCommand. > */ > cmdPtr->refCount++; 2025a2033,2038 > /* > * Now free the Command structure, if the "oldName" command has > * been deleted by invocation of rename traces. > */ > TclCleanupCommand(cmdPtr); > 2525,2527c2538,2545 < * While a rename trace is active, we will not process any more < * rename traces; while a delete trace is active we will not < * process any more delete traces --- > * While a rename trace is active, we will not process any more > * rename traces; while if a delete trace is active we will never > * reach here -- because Tcl_DeleteCommandFromToken checks for the > * condition (cmdPtr->flags & CMD_IS_DELETED) and returns immediately > * when a command deletion is in progress. For all other traces, > * delete traces will not be invoked but a call to TraceCommandProc > * will ensure that tracePtr->clientData is freed whenever the > * command "oldName" is deleted. 2531,2533d2548 < } < if (cmdPtr->flags & TCL_TRACE_DELETE) { < flags &= ~TCL_TRACE_DELETE; - login: "hemanglavana"
- mimetype: "text/plain"
- username: "hemanglavana"