summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lwlib/lwlib.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index c2f2f05cba5..1f858cbea3d 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -113,7 +113,6 @@ safe_free_str (s)
static widget_value *widget_value_free_list = 0;
static int malloc_cpt = 0;
-static int malloc_cpt_id = 0;
widget_value *
malloc_widget_value ()
@@ -144,17 +143,12 @@ free_widget_value (wv)
if (wv->free_list)
abort ();
- if (malloc_cpt > 20)
+ if (malloc_cpt > 25)
{
/* When the number of already allocated cells is too big,
We free it. */
- malloc_cpt_id++;
free (wv);
- if (malloc_cpt_id > 20)
- {
- malloc_cpt_id = 0;
- malloc_cpt = 0;
- }
+ malloc_cpt--;
}
else
{