Fixed crash in mod_clear()
This commit is contained in:
parent
c90e89b4fb
commit
14c975ca1f
|
@ -152,6 +152,9 @@ void mod_activate(struct Mod* mod) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void mod_clear(struct Mod* mod) {
|
void mod_clear(struct Mod* mod) {
|
||||||
|
if (!mod) { return; }
|
||||||
|
|
||||||
|
if (mod->files) {
|
||||||
for (int j = 0; j < mod->fileCount; j++) {
|
for (int j = 0; j < mod->fileCount; j++) {
|
||||||
struct ModFile* file = &mod->files[j];
|
struct ModFile* file = &mod->files[j];
|
||||||
if (file->fp != NULL) {
|
if (file->fp != NULL) {
|
||||||
|
@ -163,6 +166,7 @@ void mod_clear(struct Mod* mod) {
|
||||||
file->cachedPath = NULL;
|
file->cachedPath = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mod->name != NULL) {
|
if (mod->name != NULL) {
|
||||||
free(mod->name);
|
free(mod->name);
|
||||||
|
|
Loading…
Reference in New Issue