mirror of
https://github.com/thepigeongenerator/sdl_template.git
synced 2025-12-17 05:55:47 +01:00
fix: don't free gametime, it is stack-allocated
This commit is contained in:
@@ -23,6 +23,5 @@ void game_update(gamedata* dat) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void game_free(gamedata* dat) {
|
void game_free(gamedata* dat) {
|
||||||
gametime_free(dat->time);
|
|
||||||
*dat = (gamedata){0};
|
*dat = (gamedata){0};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "../util/attributes.h"
|
#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
|
// updates the internal variables
|
||||||
static inline void gametime_update(gametime* gt) {
|
static inline void gametime_update(gametime* gt) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|||||||
Reference in New Issue
Block a user