From 8f81a22e7f26729cc2f4902ba7db8f696314539f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 26 Jan 2018 10:40:04 +0100 Subject: 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 --- desktop-widgets/mainwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 3c70f73f4..ac6289f34 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -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(), -- cgit v1.2.3-70-g09d2