diff options
author | Evan Huus <eapache@gmail.com> | 2012-10-08 15:23:36 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2012-10-08 15:23:36 +0000 |
commit | b6f0d11c6f538a6214af9e93ce07f8fde227460b (patch) | |
tree | 675372de1de864ff91efa2d767c96404fcc5020c /epan/epan.c | |
parent | 92c3bc0228b40742c079a03b41f2b25d3e8591d6 (diff) |
EDT structures now own their ep_ memory pools. This should finally clean
up the last little bits of:
- https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5284
- https://www.wireshark.org/lists/wireshark-dev/201208/msg00128.html
and possibly part of:
- https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7775
This is a fairly invasive change that required some funky work with linked
lists to avoid changing any of the public ep_* APIs, so if something breaks
blame me :)
svn path=/trunk/; revision=45389
Diffstat (limited to 'epan/epan.c')
-rw-r--r-- | epan/epan.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/epan/epan.c b/epan/epan.c index ffbc537974..3bb6eda095 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -65,13 +65,6 @@ #include <ares_version.h> #endif -/* - * Refcount the edt:s and don't free ep memory until refcount = 0 - * See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5284 - * - */ -static guint edt_refs = 0; - const gchar* epan_get_version(void) { return VERSION; @@ -171,7 +164,7 @@ epan_dissect_init(epan_dissect_t *edt, const gboolean create_proto_tree, const g edt->pi.dependent_frames = NULL; - edt_refs++; + edt->mem = ep_create_pool(); return edt; } @@ -217,10 +210,7 @@ epan_dissect_cleanup(epan_dissect_t* edt) proto_tree_free(edt->tree); } - edt_refs--; - - if (edt_refs == 0) - ep_free_all(); + ep_free_pool(edt->mem); } void @@ -362,3 +352,16 @@ _U_ g_string_append_printf(str, ", Gcrypt %s", gcry_check_version(NULL)); #endif /* HAVE_LIBGCRYPT */ } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ |