diff options
-rw-r--r-- | epan/packet.c | 14 | ||||
-rw-r--r-- | epan/packet.h | 3 | ||||
-rw-r--r-- | file.c | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/epan/packet.c b/epan/packet.c index 2b3bc50c78..db3f2a7591 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -118,6 +118,14 @@ call_init_routine(gpointer routine, gpointer dummy _U_) (*func)(); } +/* + * XXX - for now, these are the same; the "init" routines free whatever + * stuff is left over from any previous dissection, and then initialize + * their tables. + * + * We should probably split that into "init" and "cleanup" routines, for + * cleanliness' sake. + */ void init_dissection(void) { @@ -137,6 +145,12 @@ init_dissection(void) reassemble_init(); } +void +cleanup_dissection(void) +{ + init_dissection(); +} + /* Allow protocols to register a "cleanup" routine to be * run after the initial sequential run through the packets. * Note that the file can still be open after this; this is not diff --git a/epan/packet.h b/epan/packet.h index 57ebb3107a..cdc2f8ff9e 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -322,6 +322,9 @@ extern void register_init_routine(void (*func)(void)); /* Initialize all data structures used for dissection. */ extern void init_dissection(void); +/* Free data structures allocated for dissection. */ +extern void cleanup_dissection(void); + /* Allow protocols to register a "cleanup" routine to be * run after the initial sequential run through the packets. * Note that the file can still be open after this; this is not @@ -313,6 +313,8 @@ cf_close(capture_file *cf) { cf_reset_state(cf); + cleanup_dissection(); + cf_callback_invoke(cf_cb_file_closed, cf); } |