mirror of
https://github.com/glest/glest-source.git
synced 2025-09-30 01:18:58 +02:00
- 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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user