Deallocate a session-duration function descriptor

The session-duration function descriptor has a PER_SESSION memory duration. The function descriptor remains active until either of the following events occurs:
  • The mi_routine_end() function explicitly releases the session-duration function descriptor.
    To explicitly free a session-duration function descriptor, you must free both the function descriptor with mi_routine_end() and the associated PER_SESSION named memory with mi_named_free(), as the following code fragment shows:
    /* Free resources for the session-duration function
     * descriptor 
     */
    if ( mi_routine_end(sess_conn, *fdesc) != MI_OK )
       {
       /* Handle error */
       ...
       }
    mi_named_free("funcptr_blk", PER_SESSION);
  • The client application ends the session.

    The database server automatically frees memory for the session-duration function descriptor and its PER_SESSION named memory at the end of the session.