Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

void nl_object_free ( struct nl_object *  obj  ) 

Free a cacheable object

  • obj object to free
Returns:
0 or a negative error code.

Definition at line 133 of file object.c.

References nl_cache_remove(), and nl_object_ops::oo_free_data.

Referenced by nl_object_clone(), and nl_object_put().

{
      struct nl_object_ops *ops = obj_ops(obj);

      if (obj->ce_refcnt > 0)
            NL_DBG(1, "Warning: Freeing object in use...\n");

      if (obj->ce_cache)
            nl_cache_remove(obj);

      if (ops->oo_free_data)
            ops->oo_free_data(obj);

      free(obj);

      NL_DBG(4, "Freed object %p\n", obj);
}


Generated by  Doxygen 1.6.0   Back to index