mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
fixing crash when initializing the mlx multiple times
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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;
|
||||
|
||||
Reference in New Issue
Block a user