> Date: Mon, 21 Jul 2008 23:27:40 +0200
 > From: [EMAIL PROTECTED]
 > 
 > Hi Gerel.
 > 
 >    [EMAIL PROTECTED] disp_fn
 >    +The function called when @var{element} is removed, can be NULL.
 > 
 > Would be good to explain there what the function does if the parameter
 > is NULL.

Sure.

 > 
 >    +  if (pdf_hash_add (props_hash, "isHidden", (void *) is_hidden,NULL) !=
 >    +      PDF_OK)
 >    +    {
 >    +      return PDF_ERROR;
 >    +    }
 > 
 > Will the memory used by 'is_hidden' be released when the hash is
 > destroyed being the last parameter NULL? As far as I understand in
 > this case the dispose function defined for the hash will be applied.
 > 

Right, we have two choices,

1. we pass each function call the element dispose function.
2. we give it at creation time, i.e. pdf_hash_create(). But now that I see
pdf_fsys_item_props_to_hash() doesn't create the hash table, which should if we
want to do this.


 > Also, in the same function:
 > 
 >  newelt->key = key;
 >  ...
 >  gl_sortedlist_add ((gl_list_t)table.keys, key_compare, key);
 > 
 > Is 'gl_sortedlist_add' making a copy of 'key'?

No, it is not. Also, remember that if the key is allocated from the heap you
could give pdf_hash_create() the key dispose function if you need to.

cheers

-gerel


Reply via email to