From 76fdd3c76eb4dbb202657ac3d7cd325edfcb24a4 Mon Sep 17 00:00:00 2001 From: CatChow0 Date: Wed, 17 Sep 2025 16:47:01 +0200 Subject: [PATCH] Patch - Adds component shutdown functionality - V13.6.1 Implements a shutdown mechanism for components and entities, ensuring proper resource release and preventing memory leaks. This change introduces a virtual `Shutdown` method to the `Component` class, allowing derived components to release specific resources when they are removed from an entity or when the entity is destroyed. The `Entity` class now calls the `Shutdown` method on all its components during its own release process. The `EntityManager` now calls the `release()` method when destroying an entity. This enhancement ensures that resources, such as FMOD sound objects and channels in the `AudioComponent`, are properly released, preventing potential resource leaks and improving the stability of the engine. --- .../.idea/workspace.xml | 38 +++++++++---------- enginecustom/src/inc/system/ecs/component.h | 5 +++ .../system/ecs/components/audio_component.h | 21 ++++++++++ enginecustom/src/inc/system/ecs/entity.h | 16 ++++++++ .../src/inc/system/ecs/entity_manager.h | 1 + 5 files changed, 62 insertions(+), 19 deletions(-) diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml b/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml index 467c771..2939729 100644 --- a/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml +++ b/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml @@ -62,26 +62,26 @@