JDF-731 Fix memory leak encountered during deletion with Bot