Ensure frames are only freed once.