Fixed: invalid memory release at cdReleaseState.