Logo Search packages:      
Sourcecode: mathwar version File versions  Download package

void destroy_player ( player_object player  ) 

Destroy a player object, freeing all memory used by it.

Parameters:
player The player to be destroyed.
Returns:
Nothing.

Definition at line 69 of file player.c.

References COMPUTER, and HUMAN.

{
   g_return_if_fail (player != NULL);
   g_return_if_fail (player->name != NULL);
   g_return_if_fail (player->type == HUMAN || player->type == COMPUTER);

   g_string_free (player->name, TRUE);
   player->name = NULL;
   player->type = 0;
   g_free (player);
}


Generated by  Doxygen 1.6.0   Back to index