Toolkit Tutorial: Programming


  /* The molecule sequence does not refer to another object. */
 
if ( dt_base ( container ) == NULL_OB )
   
printf ( "There is no base object of the sequence.\n" );

 
/* The proper way to deallocate a sequence and its
    contents is to reset the container, delete and
    deallocate each item, then deallocate the container. */

 
dt_reset ( container );
 
while ( NULL_OB != ( object = dt_next ( container ))) {
   
dt_delete ( object );
   
dt_dealloc ( object );
 
}
 
dt_dealloc ( container );