[Iup-users] Memory again, sorry.

Antonio Scuri scuri at tecgraf.puc-rio.br
Sun Apr 13 23:37:28 GMT+2 2008


> IupSetAttribute does not duplicate the attribute sent, but 
> IupStoreAttribute does, correct?

  Yes.


> Now, it seems that IupSetAttributes does duplicate the values? So:
> 
> {
>   char *attrs = strdup("VALUE=John,SIZE=20x20");
>   IupSetAttributes(control, attrs);
>   free(attrs);
> }
> 
> ... I realize the strdup and free are useless here, but I 
> added for greater clarity of what I am speaking about.

  Yes, they are useless. IupSetAttributes uses IupStoreAttribute internally.


> Now, what about values sent to controls such as IupButton and 
> IupValue?
> 
> IupLabel("My Label")
> 
> is "My Label" duplicated? The same with other similar 
> controls, such as IupButton("Name", "Action")...

  They all use IupStoreAttribute internally.

Best,
Scuri




More information about the iup-users mailing list