diff options
author | krj <krj@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-09-06 18:25:23 +0000 |
---|---|---|
committer | krj <krj@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-09-06 18:25:23 +0000 |
commit | 08963ce918c7b26797ef11db151e4306273b264b (patch) | |
tree | 3906bcb3782e7eeaccdf0142093b63c249a57593 /epan/packet.c | |
parent | e0474c2345e6247721851cd854be9824fcf46c21 (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29754 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/packet.c')
-rw-r--r-- | epan/packet.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/epan/packet.c b/epan/packet.c index 249310da89..82d78ccb1c 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -142,7 +142,7 @@ init_dissection(void) /* Initialize the common data structures for fragment reassembly. Must be done *after* calling init routines, as those routines may free up space for fragments, which they find by using the - data structures that "reassemble_init()" frees. */ + data structures that "reassemble_cleanup()" frees. */ reassemble_init(); /* Initialize the stream-handling tables */ @@ -155,7 +155,30 @@ init_dissection(void) void cleanup_dissection(void) { - init_dissection(); + /* Reclaim all memory of seasonal scope */ + se_free_all(); + + /* Cleanup the table of conversations. */ + epan_conversation_cleanup(); + + /* Cleanup the table of circuits. */ + epan_circuit_cleanup(); + + /* TODO: Introduce cleanup_routines */ + /* Cleanup protocol-specific variables. */ + g_slist_foreach(init_routines, &call_init_routine, NULL); + + /* Cleanup the common data structures for fragment reassembly. + Must be done *after* calling init routines, as those routines + may free up space for fragments, which they find by using the + data structures that "reassemble_cleanup()" frees. */ + reassemble_cleanup(); + + /* Cleanup the stream-handling tables */ + stream_cleanup(); + + /* Initialize the expert infos */ + expert_cleanup(); } /* Allow protocols to register a "cleanup" routine to be |