diff --git a/examples/win_canvas/main.c b/examples/win_canvas/main.c index ed4887f..1c01426 100644 --- a/examples/win_canvas/main.c +++ b/examples/win_canvas/main.c @@ -22,9 +22,7 @@ mg_font create_font() { //NOTE(martin): create font str8 fontPath = mp_app_get_resource_path(mem_scratch(), "../resources/OpenSansLatinSubset.ttf"); -// char* fontPathCString = str8_to_cstring(mem_scratch(), fontPath); - - char* fontPathCString = "resources/OpenSansLatinSubset.ttf"; + char* fontPathCString = str8_to_cstring(mem_scratch(), fontPath); FILE* fontFile = fopen(fontPathCString, "r"); if(!fontFile) @@ -238,8 +236,11 @@ int main() frameTime = mp_get_time(MP_CLOCK_MONOTONIC) - startTime; } + mg_font_destroy(font); mg_canvas_destroy(canvas); mg_surface_destroy(surface); + mp_window_destroy(window); + mp_terminate(); return(0); diff --git a/src/glsl_shaders.h b/src/glsl_shaders.h index 0c847fa..70e408d 100644 --- a/src/glsl_shaders.h +++ b/src/glsl_shaders.h @@ -2,7 +2,7 @@ * * file: glsl_shaders.h * note: string literals auto-generated by embed_text.py -* date: 09/022023 +* date: 10/022023 * **********************************************************************/ #ifndef __GLSL_SHADERS_H__ diff --git a/src/graphics.c b/src/graphics.c index 41f5f55..17dddb6 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -2306,7 +2306,6 @@ void mg_font_destroy(mg_font fontHandle) free(fontData->glyphMap); free(fontData->glyphs); free(fontData->outlines); - free(fontData); mg_resource_handle_recycle(&__mgData.fonts, fontHandle.h); } diff --git a/todo.txt b/todo.txt index 06c00f5..40a6629 100644 --- a/todo.txt +++ b/todo.txt @@ -32,7 +32,7 @@ Clean+Fixes [x] Destroy canvas backend properly [x] Destroy surface properly -[ ] Destroy window properly +[x] Destroy window properly [>] Make surface backend and canvas backend compile-time and run-time selections easier