Corrected topic management.
This commit is contained in:
parent
8e350ac509
commit
8f547d6e37
|
|
@ -1 +1 @@
|
||||||
Subproject commit 152be5f888f7c5c44d0cee77c21d75abf78ec410
|
Subproject commit 009d463a65bd478add7a6cb9c226f5efad6d4aa3
|
||||||
|
|
@ -31,6 +31,5 @@ int interact_component_draw(const component_t *component);
|
||||||
int interact_component_destroy(component_t *component);
|
int interact_component_destroy(component_t *component);
|
||||||
|
|
||||||
int interact_component_interact(component_t *component);
|
int interact_component_interact(component_t *component);
|
||||||
int interact_component_modify_topic_id(component_t *component, size_t id);
|
|
||||||
|
|
||||||
#endif // TRANSFORM_COMPONENT_H
|
#endif // TRANSFORM_COMPONENT_H
|
||||||
|
|
@ -28,9 +28,6 @@ inline int interact_component_init(component_t *component)
|
||||||
};
|
};
|
||||||
|
|
||||||
component_data->topic_id = 0;
|
component_data->topic_id = 0;
|
||||||
|
|
||||||
if(event_bus_new_topic(component_data->topic_id)) return_failure_int;
|
|
||||||
|
|
||||||
component_data->activated = true;
|
component_data->activated = true;
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
@ -66,6 +63,8 @@ inline int interact_component_destroy(component_t *component)
|
||||||
{
|
{
|
||||||
interact_component_data_t *component_data = component->data;
|
interact_component_data_t *component_data = component->data;
|
||||||
|
|
||||||
|
if(event_bus_remove_topic(component_data->topic_id)) return_failure_int;
|
||||||
|
|
||||||
free(component_data);
|
free(component_data);
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
@ -90,14 +89,3 @@ inline int interact_component_interact(component_t *component)
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int interact_component_modify_topic_id(component_t *component, size_t id)
|
|
||||||
{
|
|
||||||
interact_component_data_t *component_data = component->data;
|
|
||||||
|
|
||||||
if(event_bus_change_topic_id(component_data->topic_id, id)) return_failure_int;
|
|
||||||
|
|
||||||
component_data->topic_id = id;
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue