- got built in memory leak working. Just edit leak_dumper.h and uncomment:

//#define SL_LEAK_DUMP
- got better / more accurate stack dumps when we detect errors in game.
- Both of these need to be worked on in windows next, win32 may not compile for now until i fix it on that platform.
- BE VERY CAREFUL when working in leak_dumper.* it may cause GCC and your system to crash if you don't know what you are doing!
This commit is contained in:
Mark Vejvoda
2012-04-14 21:21:09 +00:00
parent ed201fa5d3
commit 8c0bf75bf5
117 changed files with 1760 additions and 1071 deletions

View File

@@ -101,7 +101,7 @@ bool Checksum::addFileToSum(const string &path) {
}
else
{
throw runtime_error("Can not open file: " + path);
throw megaglest_runtime_error("Can not open file: " + path);
}
fclose(file);
*/
@@ -116,15 +116,15 @@ bool Checksum::addFileToSum(const string &path) {
const char *infile = path.c_str();
if ((fd = open(infile,O_RDONLY)) < 0)
throw runtime_error("Can not open file: " + path);
throw megaglest_runtime_error("Can not open file: " + path);
if ((data = (int8 *)malloc(bytes_expected)) == NULL)
throw runtime_error("malloc failed, Can not open file: " + path);
throw megaglest_runtime_error("malloc failed, Can not open file: " + path);
bytes_read = read(fd, data, bytes_expected);
//if (bytes_read != bytes_expected)
// throw runtime_error("read failed, Can not open file: " + path);
// throw megaglest_runtime_error("read failed, Can not open file: " + path);
for(int i = 0; i < bytes_read; i++) {
addByte(data[i]);
@@ -184,7 +184,7 @@ bool Checksum::addFileToSum(const string &path) {
}
}
else {
throw runtime_error("Can not open file: " + path);
throw megaglest_runtime_error("Can not open file: " + path);
}
fclose(file);
return fileExists;