Make report_error() reentrant

Remove the global error buffer and pass the error string directly
to the frontend. The frontend is then responsible for accumulating
errors.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-01-26 10:40:04 +01:00 committed by Jan Mulder
parent f8f14c5edb
commit 8f81a22e7f
4 changed files with 17 additions and 34 deletions

View file

@ -89,9 +89,11 @@ extern "C" int updateProgress(const char *text)
MainWindow *MainWindow::m_Instance = NULL;
extern "C" void showErrorFromC()
extern "C" void showErrorFromC(char *buf)
{
emit MainWindow::instance()->showError(get_error_string());
QString error(buf);
free(buf);
emit MainWindow::instance()->showError(error);
}
MainWindow::MainWindow() : QMainWindow(),