Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl_CreateObjTrace: allow delProc = NULL

Closed / Accepted534728ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-03-25 16:06:37
Version: Tcl8.4a4 (CVS Head)

From the man page for Tcl_CreateObjTrace:

Tcl_CmdObjTraceDeleteProc *deleteProc ()
Procedure to call when the trace is deleted. See below
for details of the calling sequence. A null pointer is
permissible and results in no callback when the trace
is deleted.

However, specifying deleteProc as NULL results in
segmentation fault. The following patch fixes this problem:

godel:28> cvs diff tclBasic.c 
Index: tclBasic.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v
retrieving revision 1.52
diff -r1.52 tclBasic.c
4963c4963
<      * Execute any delete callback.
---
>      * Execute any delete callback, if not NULL.
4966c4966,4968
<     ( tracePtr->delProc )( tracePtr->clientData );
---
>     if ( (tracePtr->delProc) != NULL) {
>         ( tracePtr->delProc )( tracePtr->clientData );
>     }

Next, there is one documentation typo in its man page:

godel:39> cvs diff CrtTrace.3
Index: CrtTrace.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/CrtTrace.3,v
retrieving revision 1.3
diff -r1.3 CrtTrace.3
38c38
< .AP Tcl_CmdObjTraceProc *proc in
---
> .AP Tcl_CmdObjTraceProc *objProc in
msoferplain2002-03-25 23:35:45
Logged In: YES 
user_id=148712

Thanks; patch committed.
Log in (anonymous is fine) to add a comment.