Free a row structure

A row structure has the current memory duration. A row remains valid until one of the following events occurs:
  • The mi_row_free() function frees the row.
  • The current memory duration expires. (Server only)
  • The mi_close() function closes the current connection.

To conserve resources, use the mi_row_free() function to explicitly deallocate the row once your DataBlade® API module no longer needs it. The mi_row_free() function is the destructor function for a row structure. It frees the row and any resources that are associated with it.

Server only:

In a C UDR, the row structure and row descriptor are part of the same data type structure. The mi_row_create() function just adds a data buffer, which holds the column values of a row, to the row descriptor. The mi_row_free() function drops the row structure from the row descriptor. It is useful for big rows where the data you want has already been examined.

However, the mi_row_desc_free() function frees a row descriptor and the associated row structure. After mi_row_desc_free() frees the row descriptor, you no longer have access to the row structure. Examine the contents of a row structure before you deallocate the row descriptor with mi_row_desc_free().

Client only: In a client LIBMI application, a row structure and a row descriptor are separate data type structures. When you free a row descriptor with mi_row_desc_free(), the associated row structure is not freed. You must explicitly free the row structure with mi_row_free().
Important: Use mi_row_free() only for row structures that you have explicitly allocated with mi_row_create(). Do not use this function to free row structures that other DataBlade API functions (such as mi_next_row()) allocate.