forked from github/server
memory leak: gamedata store was not released
This commit is contained in:
parent
349a67ece3
commit
cdf6d3992e
|
@ -23,11 +23,6 @@ void gamedata_init(gamedata *data, storage *store, int version) {
|
||||||
binstore_init(data->store, &data->strm);
|
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) {
|
int gamedata_openfile(gamedata *data, const char *filename, const char *mode, int version) {
|
||||||
FILE *F = fopen(filename, mode);
|
FILE *F = fopen(filename, mode);
|
||||||
if (F) {
|
if (F) {
|
||||||
|
@ -70,3 +65,9 @@ gamedata *gamedata_open(const char *filename, const char *mode, int version) {
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gamedata_close(gamedata *data) {
|
||||||
|
gamedata_done(data);
|
||||||
|
fstream_done(&data->strm);
|
||||||
|
free(data->store);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue