mirror of
https://github.com/glest/glest-source.git
synced 2025-08-12 19:33:59 +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:
@@ -18,6 +18,7 @@
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <locale>
|
||||
#include "platform_util.h"
|
||||
#include "leak_dumper.h"
|
||||
|
||||
using namespace std;
|
||||
@@ -33,7 +34,7 @@ bool strToBool(const string &s) {
|
||||
if(s=="1" || s=="true") {
|
||||
return true;
|
||||
}
|
||||
throw runtime_error("Error converting string to bool, expected 0 or 1, found: [" + s + "]");
|
||||
throw megaglest_runtime_error("Error converting string to bool, expected 0 or 1, found: [" + s + "]");
|
||||
}
|
||||
|
||||
int strToInt(const string &s){
|
||||
@@ -42,7 +43,7 @@ int strToInt(const string &s){
|
||||
int intValue= strtol(s.c_str(), &endChar, 10);
|
||||
|
||||
if(*endChar!='\0'){
|
||||
throw runtime_error("Error converting from string to int, found: [" + s + "]");
|
||||
throw megaglest_runtime_error("Error converting from string to int, found: [" + s + "]");
|
||||
}
|
||||
|
||||
return intValue;
|
||||
@@ -56,7 +57,7 @@ float strToFloat(const string &s){
|
||||
float floatValue= static_cast<float>(strtod(s.c_str(), &endChar));
|
||||
|
||||
if(*endChar!='\0'){
|
||||
throw runtime_error("Error converting from string to float, found: [" + s + "]");
|
||||
throw megaglest_runtime_error("Error converting from string to float, found: [" + s + "]");
|
||||
}
|
||||
|
||||
return floatValue;
|
||||
|
Reference in New Issue
Block a user