Free string after converting to value when getting the SystemDirectory

This commit is contained in:
Jonathan Como
2016-03-09 16:07:09 -08:00
parent 429789ef78
commit 72184c843c

View File

@@ -988,7 +988,14 @@ namespace lime {
value lime_system_get_directory (int type, HxString company, HxString title) {
const char* path = System::GetDirectory ((SystemDirectory)type, company.__s, title.__s);
return path ? alloc_string (path) : alloc_null ();
if (path) {
value dirPath = alloc_string(path);
free((char *)dirPath);
return dirPath;
} else {
return alloc_null();
}
}
@@ -1365,4 +1372,4 @@ extern "C" int lime_register_prims () {
return 0;
}
}