logic: fixed some crashes

* verbose ast visitor logs the file that is currently visited.
* fixed crash in log controller
* fixed crash when solving the name of an anonymous element that has no valid location
This commit is contained in:
malte_langkabel
2016-11-28 16:10:01 +01:00
parent 0fad00e6f2
commit 1b15933819
5 changed files with 22 additions and 9 deletions
@@ -8,6 +8,7 @@ LogController::LogController()
: Logger("WindowLogger")
, m_enabled(false)
, m_previousLogCount(0)
, m_waiting(false)
{
}
@@ -97,14 +98,16 @@ void LogController::addLog(Logger::LogLevel type, const LogMessage& message)
)
);
if (m_waiting.try_lock())
if (!m_waiting)
{
m_waiting = true;
std::thread([&]()
{
std::this_thread::sleep_for( std::chrono::seconds(1) );
syncLogs();
m_waiting.unlock();
}).detach();
m_waiting = false;
}
).detach();
}
}
+1 -3
View File
@@ -1,8 +1,6 @@
#ifndef LOG_CONTROLLER_H
#define LOG_CONTROLLER_H
#include <mutex>
#include "component/controller/Controller.h"
#include "component/view/LogView.h"
@@ -44,7 +42,7 @@ private:
void addLog(Logger::LogLevel type, const LogMessage& message);
void syncLogs();
std::mutex m_waiting;
bool m_waiting;
int m_previousLogCount;
Logger::LogLevelMask m_logLevel;
};