Tcl_CallWhenDeleted(3tcl)
π NAME π
okay so bestie, this is Tcl_CallWhenDeleted(3tcl) from the Tcl Library Procedures β and it's all about arranging a callback for when an interpreter is deleted. cleanup era. π
Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted β arrange for callback when interpreter is deleted.
β¨ SYNOPSIS β¨
#include <tcl.h>
Tcl_CallWhenDeleted(interp, proc, clientData)
Tcl_DontCallWhenDeleted(interp, proc, clientData)
π ARGUMENTS π
Tcl_Interp *interp(in) β the interpreter with which to associated callback.Tcl_InterpDeleteProc *proc(in) β the procedure to call wheninterpis deleted.void *clientData(in) β an arbitrary one-word value to pass toproc.
π¦ DESCRIPTION π¦
Tcl_CallWhenDeleted arranges for proc to be called by Tcl_DeleteInterp if/when interp is deleted at some future time. iconic scheduling behavior. Proc will be invoked just before the interpreter is deleted, but the interpreter will still be valid at the time of the call. Proc should have arguments and result that match the type Tcl_InterpDeleteProc:
typedef void Tcl_InterpDeleteProc(
void *clientData,
Tcl_Interp *interp);
The clientData and interp parameters are copies of the clientData and interp arguments given to Tcl_CallWhenDeleted. Typically, clientData points to an application-specific data structure that proc uses to perform cleanup when an interpreter is about to go away. Proc does not return a value.
Tcl_DontCallWhenDeleted cancels a previous call to Tcl_CallWhenDeleted with the same arguments, so that proc will not be called after all when interp is deleted. If there is no deletion callback that matches interp, proc, and clientData then the call to Tcl_DontCallWhenDeleted has no effect.
Note, bestie: if the callback is being used to delete a resource that must be released on exit, Tcl_CreateExitHandler should be used to ensure that a callback is received even if the application terminates without deleting the interpreter.
πΈ SEE ALSO πΈ
Tcl_CreateExitHandler(3tcl), Tcl_CreateThreadExitHandler(3tcl)
π KEYWORDS π
callback, cleanup, delete, interpreter
mwah π
that's the page, bestie. footer says source/version: Tcl 7.0, page: Tcl_CallWhenDeleted(3tcl) β no date listed, just that 7.0 energy. πβ¨
π¦ where this page comes from
- debian trixie: tcl9.0-doc 9.0.1+dfsg-2
- ubuntu questing: tcl9.0-doc 9.0.2+dfsg-1
- ubuntu resolute: tcl9.0-doc 9.0.3+dfsg-1
- ubuntu stonking: tcl9.0-doc 9.0.4+dfsg-1
- Copyright (c) 1993 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms