The remove filter method is called when the filter stack is destroyed, or when a filter is removed from a filter stack by the filter_remove function or remove-filter SAF (applicable in Input-, Output-, Service-, and Error-class directives).
Waiting to flush buffered data when the remove method is invoked might be too late. For this reason, filters that buffer outgoing data should implement the flush filter method.
void remove(FilterLayer *layer);
FilterLayer *layer is the filter layer the filter is installed in.