Fixed bug in which animation was returned to cache before its resources were destroyed.