2

Do I to use the function free() after the use:

TCLIST *list = tcbdbrange();

or using enough :

tclistdel(list); 

Do I to free(p) for: p = (lk_key*) tclistval(list,...) or tclistdel(list) delete all elemenst of list ?

hmjd
  • 120,187
  • 20
  • 207
  • 252
Alexandre Kalendarev
  • 681
  • 2
  • 10
  • 24

1 Answers1

3

Haven't you read any documentation? These are typical questions that should be answered by the docs. As a matter of fact, they are:

Because the object of the return value is created with the function 'tclistnew', it should be deleted with the function 'tclistdel' when it is no longer in use.

I interpret that to mean that you don't have to iterate over the list and delete each element individually.

unwind
  • 391,730
  • 64
  • 469
  • 606