changeset 9:b6d6c0ffb423

Fixed some memory leaks
author thib
date Tue, 05 Aug 2008 13:24:20 +0000
parents 55b577e5f5b5
children dac3a35aeff6
files system/file.cc system/system_config.cc system/system_config.h
diffstat 3 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/system/file.cc
+++ b/system/file.cc
@@ -591,6 +591,7 @@ int FILESEARCH::InitRoot(char* root) {
 		dat_dir = root_dir;
 	} else {
 		dat_dir = new DIRFILE(dat_path);
+		delete[] dat_path;
 		dat_dir->Init();
 	}
 	searcher[ALL] = dat_dir;
--- a/system/system_config.cc
+++ b/system/system_config.cc
@@ -788,6 +788,10 @@ AyuSysConfig::AyuSysConfig(void) {
 
 	SetOrigParam("#SCREENSIZE_MOD", 1, 0); /* 0 = 640x480; 1 = 800x600 */
 }
+AyuSysConfig::~AyuSysConfig(void) {
+	delete str_config;
+	delete int_config;
+}
 
 static int SplitVar(const char* str, int* ret_var, int ret_size) {
 	/* , あるいは ),:( をセパレータとして、-?[0-9]+ の
--- a/system/system_config.h
+++ b/system/system_config.h
@@ -42,6 +42,7 @@ public:
 
 public:
 	AyuSysConfig(void);
+	~AyuSysConfig();
 	bool LoadInitFile(void);
 	/* パラメータを検索する */
 	/* str なら 1, int なら 2, 見つからないなら 0 */