> Date: Tue, 11 Mar 2008 19:25:21 +0100
> From: [EMAIL PROTECTED]
>
>
> Ok, I finally got the new API working.
> There are some changes for the API documentation though. Functions
> pdf_list_iterator() and pdf_list_iterator_from_to() may fail when calling
> pdf_alloc() so the caller must check for the NULL value before using it.
>
> No problem. We can change the documentation in gnupdf.texi.
>
> inline pdf_status_t
> pdf_list_iterator_free (pdf_list_iterator_t *iterator)
> {
> - gl_list_iterator_free (iterator);
> + gl_list_iterator_free ((gl_list_iterator_t*)(iterator->gl_iterator));
> +
> + pdf_dealloc (iterator->gl_iterator);
> +
> return PDF_OK;
> }
>
> Is that `pdf_dealloc' on iterator->gl_iterator ok? I think that the
> previous `gl_list_iterator_free' call is disposing the memory pointed
> by iterator->gl_iterator.
>
Well, gl_list_iterator() returns a structure and structures are assignable,
so it may be that gl_list_free() frees gl_list_iterator_t _members_ but not the
actual structure. If it does in a future update then gl_list_iterator() should
return a pointer if any coherence is to be kept.
Moreover, I checked gl_array_list.c and this is what's defined:
##
static void
gl_array_iterator_free (gl_list_iterator_t *iterator)
{
}
###
It seems right.
-gerel
>