player_free function