| 773 | */ |
| 774 | |
| 775 | rt_object_t rt_custom_object_create(const char *name, void *data, rt_err_t (*data_destroy)(void *)) |
| 776 | { |
| 777 | struct rt_custom_object *cobj = RT_NULL; |
| 778 | |
| 779 | cobj = (struct rt_custom_object *)rt_object_allocate(RT_Object_Class_Custom, name); |
| 780 | if (!cobj) |
| 781 | { |
| 782 | return RT_NULL; |
| 783 | } |
| 784 | cobj->destroy = data_destroy; |
| 785 | cobj->data = data; |
| 786 | return (struct rt_object *)cobj; |
| 787 | } |
| 788 | |
| 789 | /** |
| 790 | * This function will destroy a custom object |
no test coverage detected