aboutsummaryrefslogtreecommitdiffstats
path: root/epan/conversation.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/conversation.c
parentd6122ad4223c0616f3ac12b96f079f04cd83d3c4 (diff)
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/conversation.c')
-rw-r--r--epan/conversation.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/epan/conversation.c b/epan/conversation.c
index 3f0fac3126..76dd0ef3fa 100644
--- a/epan/conversation.c
+++ b/epan/conversation.c
@@ -409,12 +409,10 @@ conversation_match_no_addr2_or_port2(gconstpointer v, gconstpointer w)
}
/*
- * Initialize some variables every time a file is loaded or re-loaded.
- * Destroy all existing conversations, and create a new hash table
- * for the conversations in the new file.
+ * Destroy all existing conversations
*/
void
-conversation_init(void)
+conversation_cleanup(void)
{
/* The conversation keys are se_ allocated so they are already gone */
conversation_keys = NULL;
@@ -427,6 +425,19 @@ conversation_init(void)
if (conversation_hashtable_no_addr2_or_port2 != NULL)
g_hash_table_destroy(conversation_hashtable_no_addr2_or_port2);
+ conversation_hashtable_exact = NULL;
+ conversation_hashtable_no_addr2 = NULL;
+ conversation_hashtable_no_port2 = NULL;
+ conversation_hashtable_no_addr2_or_port2 = NULL;
+}
+
+/*
+ * Initialize some variables every time a file is loaded or re-loaded.
+ * Create a new hash table for the conversations in the new file.
+ */
+void
+conversation_init(void)
+{
/*
* Free up any space allocated for conversation protocol data
* areas.