I had this same issue with a project I am working on using version 6. This problem can happen if you do not have a transition or the transition has a condition attached that is keeping the animation from moving to another state. Your animation has to move to another state before the OnStateExit will fire.
Example: You have Idle and Jump animations. The user taps the "J" key, which triggers the Jump animation. The Jump animation doesn't transition to exit or back to idle, so the OnStateExit is never called. Make sure no condition blocks the transition from firing.