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:
@@ -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,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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user