summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-01-26 10:40:04 +0100
committerGravatar Jan Mulder <jlmulder@xs4all.nl>2018-01-31 14:47:26 +0100
commit8f81a22e7f26729cc2f4902ba7db8f696314539f (patch)
treefada0afb75654a203016e7b24ec6d1677d0622f6 /mobile-widgets
parentf8f14c5edb43aafcc1d4c689af4a91d7274a4b82 (diff)
downloadsubsurface-8f81a22e7f26729cc2f4902ba7db8f696314539f.tar.gz
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>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index e24bf8e01..18db13621 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -36,11 +36,12 @@ QMLManager *QMLManager::m_instance = NULL;
#define NOCLOUD_LOCALSTORAGE format_string("%s/cloudstorage/localrepo[master]", system_default_directory())
-extern "C" void showErrorFromC()
+extern "C" void showErrorFromC(char *buf)
{
+ QString error(buf);
+ free(buf);
// By using invokeMethod with Qt:AutoConnection, the error string is safely
// transported across thread boundaries, if not called from the UI thread.
- QString error(get_error_string());
QMetaObject::invokeMethod(QMLManager::instance(), "registerError", Qt::AutoConnection, Q_ARG(QString, error));
}