I did some investigation in the source code for axutil_array_list_free
and I noticed that the individual array elements in array_list are not
being freed up, just the entire data object.  From my diff, here is the
change I made (lines starting with the plus):

Index: util/src/array_list.c
===================================================================
--- util/src/array_list.c       (revision xxxx)
+++ util/src/array_list.c       (working copy)
@@ -258,7 +258,14 @@

     if (array_list->data)
     {
+       int i;
+       for (i = 0; i < array_list->size; i++)
+       {
+               AXIS2_FREE(env->allocator, array_list->data[i]);
+               array_list->data[i] = NULL;
+       }
         AXIS2_FREE(env->allocator, array_list->data);
+       array_list->data = NULL;
     }
     AXIS2_FREE(env->allocator, array_list);
     return;

With these new lines, I noticed that there is a slight improvement, with
less memory leakage.  The increase in memory recovery is very
beneficial, whether small or large, for me.  Is there a reason why the
individual elements were not being freed up in the first place?  Can
this be tested outside of my environment for validity?

Thanks,
Edward

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to