Skip to content

Commit

Permalink
Fixed a few meaningless memory leaks that kept popping up.
Browse files Browse the repository at this point in the history
  • Loading branch information
worstje committed Sep 28, 2010
1 parent 132847d commit 80040d8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripting/number.c
Expand Up @@ -100,6 +100,19 @@ bc_free_num (num)
*num = NULL;
}

/* Frees the memory allocated in the memory-recycling list.
* Primary use is to deafen memory leak warnings. -JW */

void
bc_free_freed_list ()
{
while (_bc_Free_list != NULL)
{
bc_num next = _bc_Free_list->n_next;
free(_bc_Free_list);
_bc_Free_list = next;
}
}

/* Intitialize the number package! */

Expand All @@ -121,6 +134,8 @@ bc_free_numbers ()
bc_free_num (&_zero_);
bc_free_num (&_one_);
bc_free_num (&_two_);

bc_free_freed_list();
}

/* Make a copy of a number! Just increments the reference count! */
Expand Down

0 comments on commit 80040d8

Please sign in to comment.