diff --git a/Exception.cpp b/Exception.cpp index aa8f721..3220f2a 100644 --- a/Exception.cpp +++ b/Exception.cpp @@ -14,7 +14,5 @@ namespace coreutils { Log(LOG_EXCEPT) << text; } - - Exception::~Exception() {} } diff --git a/Exception.h b/Exception.h index cd5fd86..66d5b37 100644 --- a/Exception.h +++ b/Exception.h @@ -9,7 +9,6 @@ namespace coreutils { public: Exception(std::string text, std::string file = __FILE__, int line = __LINE__, int errorNumber = -1); - ~Exception(); std::string className; std::string file; diff --git a/Log.cpp b/Log.cpp index 4031ab9..cdaf5c2 100644 --- a/Log.cpp +++ b/Log.cpp @@ -61,6 +61,8 @@ namespace coreutils { Log::~Log() { if(output) { + + mtx.lock(); std::stringstream out; out << seq << "." << this->str() << std::endl;; @@ -73,6 +75,8 @@ namespace coreutils { std::cout << out.str(); ++seq; + + mtx.unlock(); } } diff --git a/Log.h b/Log.h index 801ebce..4dbe5d3 100644 --- a/Log.h +++ b/Log.h @@ -86,6 +86,9 @@ namespace coreutils { /// static int seq; + + private: + std::mutex mtx; }; diff --git a/compile b/compile index c8e34b9..9121962 100755 --- a/compile +++ b/compile @@ -5,7 +5,7 @@ do filename="${file%.*}" list="$list $filename.o" echo -n "Compiling $filename..." - g++ -c $file & + g++ -g -c $file if [ $? = '0' ] then echo "OK" diff --git a/includes b/includes index 0c4b0ca..a7773eb 100644 --- a/includes +++ b/includes @@ -1,4 +1,4 @@ -#define _GLIBCXX_USE_CXX11_ABI 0 + #include #include