* This function will destroy a custom object * container. * * @param obj the specified name of object. * * @note this function shall not be invoked in interrupt status. */
| 795 | * @note this function shall not be invoked in interrupt status. |
| 796 | */ |
| 797 | rt_err_t rt_custom_object_destroy(rt_object_t obj) |
| 798 | { |
| 799 | rt_err_t ret = -1; |
| 800 | |
| 801 | struct rt_custom_object *cobj = (struct rt_custom_object *)obj; |
| 802 | |
| 803 | if (obj && obj->type == RT_Object_Class_Custom) |
| 804 | { |
| 805 | if (cobj->destroy) |
| 806 | { |
| 807 | ret = cobj->destroy(cobj->data); |
| 808 | } |
| 809 | rt_object_delete(obj); |
| 810 | } |
| 811 | return ret; |
| 812 | } |
| 813 | #endif |
| 814 | |
| 815 | /** @} group_object_management */ |
no test coverage detected