diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/src/loop.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/src/loop.c b/src/core/src/loop.c index 076dc05..0062173 100644 --- a/src/core/src/loop.c +++ b/src/core/src/loop.c @@ -115,11 +115,11 @@ Platform* engine_init(const char* windowtitle, i32 windowWidth, i32 windowHeight #endif v2_i32 windowsize = (v2_i32){.x = windowWidth, .y = windowHeight}; - Platform* p = (Platform*)malloc(sizeof(Platform)); - Window* w = (Window*)malloc(sizeof(Window)); + Platform* p = (Platform*)calloc(1, sizeof(Platform)); + Window* w = (Window*)calloc(1, sizeof(Window)); /* initialize resources */ - Resources* resources = malloc(sizeof(Resources)); + Resources* resources = calloc(1, sizeof(Resources)); // TODO: Initialize them :) w = init_window_glfw(windowtitle, (ivec2){windowsize.x, windowsize.y}, flags); @@ -413,6 +413,7 @@ void engine_stop(Platform* p) { //} destroy_window(p->window); + free(p->resources); } /* Set the maximum framerate */ |
