Update Font.cpp
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m33s

fix memleak
This commit is contained in:
2024-07-17 16:36:45 -04:00
parent 162732e4b7
commit 4ff8d8ff07
4 changed files with 7 additions and 4 deletions

View File

@@ -23,9 +23,8 @@ namespace JGL {
using namespace J3ML;
Vector2 wS;
bool Update(const Vector2& window_size) {
void Update(const Vector2& window_size) {
wS = window_size;
return JGL::InitTextEngine();
}

View File

@@ -49,6 +49,9 @@ namespace JGL::Detail
}
bool InitTextEngine() {
if (ft != nullptr)
throw std::runtime_error("Error::FREETYPE: FT_Library was initialized but is already initialized.");
if (FT_Init_FreeType(&ft))
return true;
return false;