11.6. Writing a Destructor Function

The server calls the destructor function to free any memory that was allocated; for example, to the indexer object or the filter object.
The destructor function takes a single Slapi_PBlock argument. The following table summarizes the different parameters that the destructor function should get and set in the parameter block that is passed in.

Table 11.6. Input and Output Parameters Available to a Destructor Function

Parameter Name Data Type Description
SLAPI_PLUGIN_OBJECT void * Input parameter. Pointer to the filter object or indexer object created by your factory function.
For example, your destructor function can get the indexer object from the SLAPI_PLUGIN_OBJECT parameter and free the object from memory.
This function will never be called for the same indexer or filter object concurrently. (If you plan to manipulate global variables, remember that the server can call this function concurrently for different filter or indexer objects.)