summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mpq-fs.c14
-rw-r--r--mpq-fs.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/mpq-fs.c b/mpq-fs.c
index 84e48a0..811de8d 100644
--- a/mpq-fs.c
+++ b/mpq-fs.c
@@ -127,3 +127,17 @@ struct mpq_file_t * mpqlib_fs_open(const char * _fname) {
return NULL;
}
+
+#define FALSE 0
+#define TRUE !FALSE
+
+void mpqlib_shutdown() {
+ if (!hash_table)
+ return;
+ if (hfirst(hash_table)) do {
+ free(hkey(hash_table));
+ } while (hnext(hash_table));
+
+ hdestroy(hash_table);
+ hash_table = 0;
+}
diff --git a/mpq-fs.h b/mpq-fs.h
index 558f21e..69e70f3 100644
--- a/mpq-fs.h
+++ b/mpq-fs.h
@@ -13,6 +13,8 @@ void mpqlib_fs_attach_listfile(struct mpq_archive_t *, const char *);
struct mpq_file_t * mpqlib_fs_open(const char *);
+void mpqlib_fs_shutdown();
+
#ifdef __cplusplus
}
#endif