Adjusted histgram animation
Fixed leak if window is closing while the animation is in progress