diff --git a/src/credits.c b/src/credits.c index 88c7a84..ac275ab 100644 --- a/src/credits.c +++ b/src/credits.c @@ -9,6 +9,7 @@ static const char matrix_proj[] = "proj"; static void init(void); static void draw(void); +static void deinit(void); void credits(int state) { switch (state) { @@ -20,6 +21,10 @@ void credits(int state) { draw(); break; + case GL4DH_FREE: + deinit(); + break; + default: break; } @@ -86,3 +91,10 @@ static void draw(void) { glUseProgram(0); } + +static void deinit(void) { + if (_texId) { + glDeleteTextures(1, &_texId); + _texId = 0; + } +}