Fixed crash on NULL window titles + typo

This commit is contained in:
Daemo
2026-08-09 02:22:57 +02:00
parent f53d90e72c
commit 83b9f8f9da
3 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ namespace mlx
inline void OnEvent(mlx_window win, int event, void(*f)(int, void*), void* param) noexcept;
inline mlx_window NewGraphicsSuport(const mlx_window_create_info* info);
inline mlx_window NewGraphicsSupport(const mlx_window_create_info* info);
inline NonOwningPtr<GraphicsSupport> GetGraphicsSupport(mlx_window win);
inline void DestroyGraphicsSupport(mlx_window win);
+7 -2
View File
@@ -60,7 +60,7 @@ namespace mlx
m_fps.SetMaxFPS(fps);
}
mlx_window Application::NewGraphicsSuport(const mlx_window_create_info* info)
mlx_window Application::NewGraphicsSupport(const mlx_window_create_info* info)
{
MLX_PROFILE_FUNCTION();
if(!info)
@@ -68,6 +68,11 @@ namespace mlx
Error("invalid window create info (NULL)");
return nullptr;
}
if (info->title == nullptr)
{
mlx::Error("invalid window title (NULL)");
return nullptr;
}
mlx_window window;
try { window = new mlx_window_handler; }
@@ -134,7 +139,7 @@ namespace mlx
{
m_hooks.emplace_back(f, param);
}
void Application::LoopEnd() noexcept
{
m_in.Finish();