memory leak: gamedata store was not released

This commit is contained in:
Enno Rehling 2016-03-11 10:31:21 +01:00
parent 349a67ece3
commit cdf6d3992e
1 changed files with 6 additions and 5 deletions

View File

@ -23,11 +23,6 @@ void gamedata_init(gamedata *data, storage *store, int version) {
binstore_init(data->store, &data->strm);
}
void gamedata_close(gamedata *data) {
gamedata_done(data);
fstream_done(&data->strm);
}
int gamedata_openfile(gamedata *data, const char *filename, const char *mode, int version) {
FILE *F = fopen(filename, mode);
if (F) {
@ -70,3 +65,9 @@ gamedata *gamedata_open(const char *filename, const char *mode, int version) {
}
return data;
}
void gamedata_close(gamedata *data) {
gamedata_done(data);
fstream_done(&data->strm);
free(data->store);
}