From e8e9e7fd576aa12a6dbee89e233d6ec1af0ef922 Mon Sep 17 00:00:00 2001 From: bjorn Date: Sun, 3 Jul 2022 12:59:51 -0700 Subject: [PATCH] Fix leaks; --- src/modules/graphics/graphics.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index 35a49d8d..ebea56ce 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -520,6 +520,7 @@ bool lovrGraphicsInit(bool debug, bool vsync) { void lovrGraphicsDestroy() { if (!state.initialized) return; cleanupPasses(); + arr_free(&state.passes); lovrRelease(state.window, lovrTextureDestroy); for (uint32_t i = 0; i < state.attachments.length; i++) { gpu_texture_destroy(state.attachments.data[i].texture); @@ -840,6 +841,7 @@ void lovrGraphicsSubmit(Pass** passes, uint32_t count) { gpu_submit(streams, total); cleanupPasses(); + arr_clear(&state.passes); if (state.window) { state.window->gpu = NULL; @@ -4062,7 +4064,6 @@ static void beginFrame(void) { state.tick = gpu_begin(); state.stream = gpu_stream_begin("Internal uploads"); state.allocator.cursor = 0; - arr_clear(&state.passes); } // Clean up ALL passes created during the frame, even unsubmitted ones