diff --git a/HMT-Extractor Debug.launch b/HMT-Extractor Debug.launch
deleted file mode 100644
index e69de29..0000000
diff --git a/HMT-Extractor Release.launch b/HMT-Extractor Release.launch
deleted file mode 100644
index e69de29..0000000
diff --git a/Texture-Extractor Debug.launch b/Texture-Extractor Debug.launch
new file mode 100644
index 0000000..5aa1357
--- /dev/null
+++ b/Texture-Extractor Debug.launch
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Texture-Extractor Release.launch b/Texture-Extractor Release.launch
new file mode 100644
index 0000000..10c879e
--- /dev/null
+++ b/Texture-Extractor Release.launch
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Texture-Extractor.c b/src/Texture-Extractor.c
index 04eb911..f92e57b 100644
--- a/src/Texture-Extractor.c
+++ b/src/Texture-Extractor.c
@@ -30,10 +30,19 @@ int main(int argc, char *argv[]) {
}
void purgeHMTFromMemory(HMT_FILE *_f) {
- free(_f->textures_list->image.pixels);
- free(_f->textures_list->image.samples);
- free(_f->materials_list);
+ if (_f == NULL) return;
+
+ if (_f->textures_list != NULL) {
+ if (_f->textures_list->image.pixels != NULL) free(_f->textures_list->image.pixels);
+ if (_f->textures_list->image.samples != NULL) free(_f->textures_list->image.samples);
+ }
+ if (_f->textures_list != NULL) {
+ if (_f->textures_list->image.pixels != NULL) free(_f->textures_list->image.pixels);
+ }
free(_f->textures_list);
+
+ if (_f->materials_list != NULL) free(_f->materials_list);
+
free(_f);
}