summaryrefslogtreecommitdiffstats
path: root/generic/tclProc.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r--generic/tclProc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 0d67c37..150d036 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -215,6 +215,7 @@ Tcl_ProcObjCmd(
*/
procPtr->cmdPtr = (Command *) cmd;
+ procPtr->cmdPtr->refCount++;
/*
* TIP #280: Remember the line the procedure body is starting on. In a
@@ -2154,6 +2155,12 @@ TclProcCleanupProc(
ckfree(localPtr);
localPtr = nextPtr;
}
+ /*
+ * TclOOMethod.c:clOOMakeProcMethod sets cmdPtr to NULL
+ */
+ if (procPtr->cmdPtr) {
+ TclCleanupCommandMacro(procPtr->cmdPtr);
+ }
ckfree(procPtr);
/*