From 8f547d6e379cfc288f074c2069718cf27040d6d2 Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Sun, 16 Aug 2026 20:48:07 +0200 Subject: [PATCH] Corrected topic management. --- SDL3_Core | 2 +- src/components/headers/interact_component.h | 1 - src/components/interact_component.c | 16 ++-------------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/SDL3_Core b/SDL3_Core index 152be5f..009d463 160000 --- a/SDL3_Core +++ b/SDL3_Core @@ -1 +1 @@ -Subproject commit 152be5f888f7c5c44d0cee77c21d75abf78ec410 +Subproject commit 009d463a65bd478add7a6cb9c226f5efad6d4aa3 diff --git a/src/components/headers/interact_component.h b/src/components/headers/interact_component.h index 671a0c1..14e45e5 100644 --- a/src/components/headers/interact_component.h +++ b/src/components/headers/interact_component.h @@ -31,6 +31,5 @@ int interact_component_draw(const component_t *component); int interact_component_destroy(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 \ No newline at end of file diff --git a/src/components/interact_component.c b/src/components/interact_component.c index 33794df..41d31e4 100644 --- a/src/components/interact_component.c +++ b/src/components/interact_component.c @@ -28,9 +28,6 @@ inline int interact_component_init(component_t *component) }; component_data->topic_id = 0; - - if(event_bus_new_topic(component_data->topic_id)) return_failure_int; - component_data->activated = true; return EXIT_SUCCESS; @@ -66,6 +63,8 @@ inline int interact_component_destroy(component_t *component) { interact_component_data_t *component_data = component->data; + if(event_bus_remove_topic(component_data->topic_id)) return_failure_int; + free(component_data); return EXIT_SUCCESS; @@ -90,14 +89,3 @@ inline int interact_component_interact(component_t *component) 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; -} \ No newline at end of file