Fires when the application-defined data stored in one or more contexts needs to be cleaned up.
The 'callback' is called when the 'CleanupContext' event is emited.
The argument 'e' has the following properties:
e.fileContext e.handleContext e.resultCode
This event fires after a file or directory is closed, just before any contexts related to it are discarded, giving applications a chance to clean up any information stored in them.
The FileContext and HandleContext parameters are placeholders for application-defined data associated with the file and specific handle, respectively. Please refer to the Contexts topic for more information.
When a handle to some file or directory is closed, this event will fire if the HandleContext associated with that handle is not . When the last handle to the file or directory is closed, this event will fire if the HandleContext associated with that handle and/or the FileContext associated with that file or directory is not . After this event fires, the applicable contexts are set back to automatically.
Applications that need to know the name of the file or directory this event is firing for should store a copy of said name in the context itself during an earlier event.
This event is optional; it will fire regardless of whether any filter rules are present, but only if FileContext, HandleContext, or both, are not already . Applications that clean up their contexts (and set them back to ) when a file is being closed, or earlier, do not need to handle this event.
The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a non-zero value to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.
This event is fired synchronously; please refer to the Event Types topic for more information.