mem leak fix and .ani cursor support