diff --git a/src/core/application.cpp b/src/core/application.cpp index 9ab3cfc..92bdd27 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */ -/* Updated: 2024/04/24 13:52:18 by maldavid ### ########.fr */ +/* Updated: 2024/10/19 10:49:21 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -118,7 +118,9 @@ namespace mlx::core Application::~Application() { TextLibrary::get().clearLibrary(); + TextLibrary::get().reset(); FontLibrary::get().clearLibrary(); + FontLibrary::get().reset(); if(__drop_sdl_responsability) return; SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_EVENTS); diff --git a/src/renderer/command/single_time_cmd_manager.cpp b/src/renderer/command/single_time_cmd_manager.cpp index b4dcf7b..baf40a3 100644 --- a/src/renderer/command/single_time_cmd_manager.cpp +++ b/src/renderer/command/single_time_cmd_manager.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/12/15 19:57:49 by maldavid #+# #+# */ -/* Updated: 2024/01/11 03:13:21 by maldavid ### ########.fr */ +/* Updated: 2024/10/19 10:47:04 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -59,5 +59,6 @@ namespace mlx buf.destroy(); }); _pool.destroy(); + _buffers.clear(); } } diff --git a/src/renderer/core/render_core.cpp b/src/renderer/core/render_core.cpp index 0a52b5c..449cf56 100644 --- a/src/renderer/core/render_core.cpp +++ b/src/renderer/core/render_core.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/17 23:33:34 by maldavid #+# #+# */ -/* Updated: 2024/04/23 20:32:54 by kiroussa ### ########.fr */ +/* Updated: 2024/10/19 10:50:13 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -116,6 +116,8 @@ namespace mlx void Render_Core::init() { + if(_is_init) + return; if(volkInitialize() != VK_SUCCESS) core::error::report(e_kind::fatal_error, "Vulkan loader : cannot load %s, are you sure Vulkan is installed on your system ?", VULKAN_LIB_NAME); @@ -144,6 +146,8 @@ namespace mlx _layers.destroy(); _instance.destroy(); + volkFinalize(); + _is_init = false; } } diff --git a/src/renderer/texts/font_library.h b/src/renderer/texts/font_library.h index 3019ea1..db6364a 100644 --- a/src/renderer/texts/font_library.h +++ b/src/renderer/texts/font_library.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/18 09:26:03 by maldavid #+# #+# */ -/* Updated: 2024/01/18 09:33:30 by maldavid ### ########.fr */ +/* Updated: 2024/10/19 10:47:32 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -38,6 +38,8 @@ namespace mlx void clearLibrary(); + inline void reset() { _cache.clear(); _invalid_ids.clear(); _current_id = 1; } + private: FontLibrary() = default; ~FontLibrary() = default; diff --git a/src/renderer/texts/text_library.h b/src/renderer/texts/text_library.h index 2b9345b..a7b3bb7 100644 --- a/src/renderer/texts/text_library.h +++ b/src/renderer/texts/text_library.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/10 11:52:30 by maldavid #+# #+# */ -/* Updated: 2024/03/25 16:04:47 by maldavid ### ########.fr */ +/* Updated: 2024/10/19 10:49:02 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,6 +39,8 @@ namespace mlx void clearLibrary(); + inline void reset() { _cache.clear(); _current_id = 1; } + private: TextLibrary() = default; ~TextLibrary() = default;