summaryrefslogtreecommitdiff
path: root/epan/circuit.c
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-09-06 18:25:23 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2009-09-06 18:25:23 +0000
commit0e5cef61be28b595269433c50b23ce71a24b9fd3 (patch)
tree3906bcb3782e7eeaccdf0142093b63c249a57593 /epan/circuit.c
parentd6122ad4223c0616f3ac12b96f079f04cd83d3c4 (diff)
downloadwireshark-0e5cef61be28b595269433c50b23ce71a24b9fd3.tar.gz
Split a bunch of init routines into init() and cleanup(). This allows us to free memory properly on shutdown.
This is an initial step. There's still some work to do. svn path=/trunk/; revision=29754
Diffstat (limited to 'epan/circuit.c')
-rw-r--r--epan/circuit.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/epan/circuit.c b/epan/circuit.c
index 73dbbce2c6..7228fd5f42 100644
--- a/epan/circuit.c
+++ b/epan/circuit.c
@@ -74,16 +74,24 @@ circuit_match(gconstpointer v, gconstpointer w)
}
/*
- * Initialize some variables every time a file is loaded or re-loaded.
- * Destroy all existing circuits, and create a new hash table
- * for the circuits in the new file.
+ * Destroy all existing circuits.
*/
void
-circuit_init(void)
+circuit_cleanup(void)
{
if (circuit_hashtable != NULL)
g_hash_table_destroy(circuit_hashtable);
+ circuit_hashtable = NULL;
+}
+
+/*
+ * Initialize some variables every time a file is loaded or re-loaded.
+ * Create a new hash table for the circuits in the new file.
+ */
+void
+circuit_init(void)
+{
/*
* Free up any space allocated for circuit protocol data
* areas.