From 734465ae9ad399c463b929195d5a738f540b8fe8 Mon Sep 17 00:00:00 2001 From: San Jacobs Date: Sun, 21 May 2023 03:18:40 +0200 Subject: Patched memory leak --- src/main.odin | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.odin b/src/main.odin index e7559ea..03b95cd 100644 --- a/src/main.odin +++ b/src/main.odin @@ -89,8 +89,13 @@ main :: proc() { DAY_HEIGHT*i32(i+1)-4, width-170, DAY_HEIGHT-1, BLUE) } + // TODO: This is bad, figure out how to overwrite the existing memory instead + // of doing these horrible repeated allocations and deallocations call_text = strings.clone_to_cstring(clockprint(day.call)) + defer delete(call_text) wrap_text = strings.clone_to_cstring(clockprint(day.wrap)) + defer delete(wrap_text) + text_height = math.round(f32(i+1)*DAY_HEIGHT+(DAY_HEIGHT-font_size)*0.25) DrawTextEx(font, call_text, {20, text_height}, font_size, 0, RAYWHITE); -- cgit v1.2.1