From f4681cfc60d41e43f4c20a21f2bb3a7a28e329a0 Mon Sep 17 00:00:00 2001 From: Quinn Date: Sat, 22 Mar 2025 14:52:13 +0100 Subject: [PATCH] fix: don't free gametime, it is stack-allocated --- src/game/game.c | 1 - src/game/gametime.h | 5 ----- 2 files changed, 6 deletions(-) diff --git a/src/game/game.c b/src/game/game.c index 0cdd5d6..06d8f9a 100644 --- a/src/game/game.c +++ b/src/game/game.c @@ -23,6 +23,5 @@ void game_update(gamedata* dat) { } void game_free(gamedata* dat) { - gametime_free(dat->time); *dat = (gamedata){0}; } diff --git a/src/game/gametime.h b/src/game/gametime.h index 1f8846f..c5ce54f 100644 --- a/src/game/gametime.h +++ b/src/game/gametime.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include "../util/attributes.h" @@ -25,10 +24,6 @@ atrb_const static inline gametime gametime_new(void) { }; } -static inline void gametime_free(gametime* gt) { - free(gt); -} - // updates the internal variables static inline void gametime_update(gametime* gt) { struct timespec ts;