A function descriptor for a UDR has a memory duration of PER_COMMAND. Therefore, a function descriptor remains active until one of the following events occurs:
To conserve resources, use the mi_routine_end( ) function to explicitly deallocate the function descriptor once your DataBlade API module no longer needs it. The mi_routine_end( ) function is the destructor function for a function descriptor. It frees the function descriptor and any resources that are associated with it.
The following call to mi_routine_end( ) explicitly releases the resources for the fdesc function descriptor that the code in Figure 51 and Figure 54 uses:
if ( mi_routine_end(conn, fdesc) != MI_OK ) /* handle error */ ...
If your UDR accesses any session-duration function descriptors, these descriptors have a memory duration of PER_SESSION. Therefore, they remain active until the end of the session. You can explicitly deallocate them with mi_routine_end( ).