# TaoAppSetDestroyRoutine

Sets an ADDITIONAL function that will be called when this application is destroyed.

## Synopsis

    #include "tao.h"
    int TaoAppSetDestroyRoutine(TAO_APPLICATION taoapp,int (*destroy)(void*),void *ctx)

Collective on TAO_APPLICATION

## Input Parameters

| taoapp | - the TAO_APPLICATION solver context
| destroy | - function pointer
| ctx | - [optional] user-defined context for private data for the destroy routine (may be TAO_NULL)

## Calling sequence of destroy

        int mydestroy(void *ctx)

ctx -[optional] destroy context

## Note

This routine is often used to destroy structures used by monitors and function evaluations. This routine may also be used to shut down other packages such as ADIC.

## Keywords

destroy

## See Also

TaoAppSetMonitor(), TaoAppSetHessianRoutine(), TaoAppDestroy()

Level:intermediate
Location:src/petsctao/application/petscapp/tao_app.c
TAO Solver Index
Table of Contents