mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-09 14:40:54 +00:00
Add a destroy notifier to StackStash
2006-07-31 Soren Sandmann <sandmann@redhat.com> * stackstash.[ch]: Add a destroy notifier to StackStash * collector.c (collector_create_profile): Pass g_free as destroy notifier. * collector.c (collector_reset): Pass NULL as destroy notifier * profile.c (profile_load): Pass g_free here. * profile.c (struct Profile): Remove unused "Node" typedef * collector.c (resolve_symbols): Free the array here. * TODO: various updates.
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
5efd06051c
commit
d43cdf3c14
@ -27,8 +27,6 @@
|
||||
#include "profile.h"
|
||||
#include "sfile.h"
|
||||
|
||||
typedef struct Node Node;
|
||||
|
||||
struct Profile
|
||||
{
|
||||
StackStash *stash;
|
||||
@ -227,7 +225,7 @@ profile_load (const char *filename, GError **err)
|
||||
sformat_free (format);
|
||||
sfile_input_free (input);
|
||||
|
||||
profile->stash = stack_stash_new_from_root (root);
|
||||
profile->stash = stack_stash_new_from_root (root, (GDestroyNotify)g_free);
|
||||
|
||||
return profile;
|
||||
}
|
||||
@ -518,10 +516,6 @@ profile_get_objects (Profile *profile)
|
||||
stack_stash_foreach_by_address (
|
||||
profile->stash, build_object_list, &objects);
|
||||
|
||||
/* FIXME: everybody still assumes that they don't have to free the
|
||||
* objects in the list, but these days they do, and so we are leaking.
|
||||
*/
|
||||
|
||||
return objects;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user