mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
f8f14c5edb
commit
8f81a22e7f
4 changed files with 17 additions and 34 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue