Commit 52f1512c authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Correctly handle #elems<=1. (unlink_range_dep): Plug leak. [#159581]

2005-02-03  Morten Welinder  <terra@gnome.org>

	* src/dependent.c.save (micro_hash_resize): Correctly handle
	#elems<=1.
	(unlink_range_dep): Plug leak.  [#159581]
parent 9eb5cb9a
2005-02-03 Morten Welinder <terra@gnome.org>
* src/dependent.c.save (micro_hash_resize): Correctly handle
#elems<=1.
(unlink_range_dep): Plug leak. [#159581]
2005-02-02 Morten Welinder <terra@gnome.org>
* src/format.c (fmt_general_float): Consistently use upper case
......
......@@ -28,6 +28,7 @@ Morten:
* Fix text import crash. [#165617]
* Fix SUBSTITUTE. [#165996]
* Fix general format's use of "e".
* Plug dependency leak. [#159581]
--------------------------------------------------------------------------
Gnumeric 1.4.2
......
2005-02-03 Morten Welinder <terra@gnome.org>
* src/dependent.c.save (micro_hash_resize): Correctly handle
#elems<=1.
(unlink_range_dep): Plug leak. [#159581]
2005-02-02 Morten Welinder <terra@gnome.org>
* src/format.c (fmt_general_float): Consistently use upper case
......
......@@ -334,12 +334,17 @@ micro_hash_resize (MicroHash *hash_table)
GSList **new_buckets, *node, *next;
guint bucket;
gint old_num_buckets = hash_table->num_buckets;
gint new_num_buckets = g_spaced_primes_closest (hash_table->num_elements);
gint new_num_buckets;
if (new_num_buckets < MICRO_HASH_MIN_SIZE)
new_num_buckets = MICRO_HASH_MIN_SIZE;
else if (new_num_buckets > MICRO_HASH_MAX_SIZE)
new_num_buckets = MICRO_HASH_MAX_SIZE;
if (hash_table->num_elements <= 1)
new_num_buckets = 1;
else {
new_num_buckets = g_spaced_primes_closest (hash_table->num_elements);
if (new_num_buckets < MICRO_HASH_MIN_SIZE)
new_num_buckets = MICRO_HASH_MIN_SIZE;
else if (new_num_buckets > MICRO_HASH_MAX_SIZE)
new_num_buckets = MICRO_HASH_MAX_SIZE;
}
if (old_num_buckets <= 1) {
if (new_num_buckets == 1)
......@@ -667,6 +672,7 @@ unlink_range_dep (GnmDepContainer *deps, GnmDependent *dep,
dep_collection_remove (result->deps, dep);
if (dep_collection_is_empty (result->deps)) {
g_hash_table_remove (deps->range_hash[i], result);
dep_collection_release (result->deps);
gnm_mem_chunk_free (deps->range_pool, result);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment