## Tcl9.0.3/Tk9.0.3 Documentation > Tcl C API > CallDel

### Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

  NAME
    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)
    Tcl_InterpDeleteProc *proc (入力in)
    void *clientData (入力in)
  説明 DESCRIPTION
  SEE ALSO
  KEYWORDS

### NAME

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)
  実行登録に結合した解釈実行機能｡ Interpreter with which to associated callback.

Tcl_InterpDeleteProc *proc (入力in)
  interp が削除された時に呼出すべき手続函数｡ Procedure to call when interp is deleted.

void *clientData (入力in)
  proc に渡す任意の１語｡ Arbitrary one-word value to pass to proc.

### 説明 DESCRIPTION

Tcl_CallWhenDeleted は何時か将来 proc が削除される時に Tcl_DeleteInterp によって呼出される様 proc を手配する｡ proc は解釈実行機能が削除される直前に起動されるが､呼出される瞬間は解釈実行機能は未だ健全である｡ proc は Tcl_InterpDeleteProc の型に合致する引数と結果を有するべきである: Tcl_CallWhenDeleted arranges for proc to be called by Tcl_DeleteInterp if/when interp is deleted at some future time. 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);

clientData と interp 媒介変数は Tcl_CallWhenDeleted に与える clientData と interp 引数の複写である｡典型的には､ clientData は応用譜固有のデータ構造へのポインタであり､解釈実行機能がなくなろうとする時に浄化を遂行するために使われる｡ proc は値を返さない｡ 　　　 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 は同じ引数を伴った以前の Tcl_CallWhenDeleted への呼出しを取消して interp が削除された時に proc は結局呼出されなくなる｡もし interp と proc と clientData に合致する削除べき実行登録がない場合､ Tcl_DontCallWhenDeleted への呼出しは効果がない｡ 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.

註意すべきは､もし実行登録が退出時に解放されなければならない原資の削除に使われた場合､縦え応用譜が解釈実行機能の削除なしで終了しても実行登録が確実に受取られるために Tcl_CreateExitHandler が使用されるべきである｡ 　　　 Note that 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, Tcl_CreateThreadExitHandler

### KEYWORDS

callback, cleanup, delete, interpreter
Copyright © 1993 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.