On 02/23/2011 07:19 AM, Jan Friesse wrote: > Patch replaces free for object_instance with handle_destroy to remove > leaks in handles (and also memory leak). > > Signed-off-by: Jan Friesse <[email protected]> > --- > exec/objdb.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/exec/objdb.c b/exec/objdb.c > index 884263b..5553263 100644 > --- a/exec/objdb.c > +++ b/exec/objdb.c > @@ -714,7 +714,7 @@ static int _clear_object(struct object_instance *instance) > > list_del(&find_instance->child_list); > free(find_instance->object_name); > - free(find_instance); > + hdb_handle_destroy (&object_instance_database, > find_instance->object_handle); > }
Had to double-take given name of variable (find_instance) but it is indeed an object instance but looks good Reviewed-by: Steven Dake <[email protected]> Please note there may be some small leaks that occur automatically as part of the hdb constructs. For Fabio: Every time hdb_handle_create is called, it may expand a global array of pointers which is never freed for the lifetime of the application. If hdb_handle_destroy is never called for a handle, then it will result in leaks of the instance (size = the 2nd parameter to hdb_handle_create). Depending on run order, it may be that you are creating new data before freeing old, which will result in a little additional memory used but then recovered after each reload. Regards -steve > > return 0; _______________________________________________ Openais mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/openais
