diff options
author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-09-06 18:25:23 +0000 |
---|---|---|
committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-09-06 18:25:23 +0000 |
commit | 0e5cef61be28b595269433c50b23ce71a24b9fd3 (patch) | |
tree | 3906bcb3782e7eeaccdf0142093b63c249a57593 /epan/packet.c | |
parent | d6122ad4223c0616f3ac12b96f079f04cd83d3c4 (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/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 |