1Tcl_CallWhenDeleted(3) Tcl Library Procedures Tcl_CallWhenDeleted(3)
2
3
4
5______________________________________________________________________________
6
8 Tcl_CallWhenDeleted, Tcl_DontCallWhenDeleted - Arrange for callback
9 when interpreter is deleted
10
12 #include <tcl.h>
13
14 Tcl_CallWhenDeleted(interp, proc, clientData)
15
16 Tcl_DontCallWhenDeleted(interp, proc, clientData)
17
19 Tcl_Interp *interp (in) Interpreter with which to
20 associated callback.
21
22 Tcl_InterpDeleteProc *proc (in) Procedure to call when
23 interp is deleted.
24
25 ClientData clientData (in) Arbitrary one-word value
26 to pass to proc.
27_________________________________________________________________
28
29
31 Tcl_CallWhenDeleted arranges for proc to be called by Tcl_DeleteInterp
32 if/when interp is deleted at some future time. Proc will be invoked
33 just before the interpreter is deleted, but the interpreter will still
34 be valid at the time of the call. Proc should have arguments and
35 result that match the type Tcl_InterpDeleteProc:
36 typedef void Tcl_InterpDeleteProc(
37 ClientData clientData,
38 Tcl_Interp *interp);
39 The clientData and interp parameters are copies of the clientData and
40 interp arguments given to Tcl_CallWhenDeleted. Typically, clientData
41 points to an application-specific data structure that proc uses to per‐
42 form cleanup when an interpreter is about to go away. Proc does not
43 return a value.
44
45 Tcl_DontCallWhenDeleted cancels a previous call to Tcl_CallWhenDeleted
46 with the same arguments, so that proc will not be called after all when
47 interp is deleted. If there is no deletion callback that matches
48 interp, proc, and clientData then the call to Tcl_DontCallWhenDeleted
49 has no effect.
50
51
53 callback, delete, interpreter
54
55
56
57Tcl 7.0 Tcl_CallWhenDeleted(3)