mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: use std::string in error_callback
No naked free(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
71f3189a31
commit
d05e289507
8 changed files with 40 additions and 74 deletions
|
@ -107,11 +107,9 @@ int updateProgress(const char *text)
|
|||
|
||||
MainWindow *MainWindow::m_Instance = nullptr;
|
||||
|
||||
void showErrorFromC(char *buf)
|
||||
static void showError(std::string err)
|
||||
{
|
||||
QString error(buf);
|
||||
free(buf);
|
||||
emit MainWindow::instance()->showError(error);
|
||||
emit MainWindow::instance()->showError(QString::fromStdString(err));
|
||||
}
|
||||
|
||||
MainWindow::MainWindow() :
|
||||
|
@ -242,7 +240,7 @@ MainWindow::MainWindow() :
|
|||
|
||||
setupSocialNetworkMenu();
|
||||
set_git_update_cb(&updateProgress);
|
||||
set_error_cb(&showErrorFromC);
|
||||
set_error_cb(&::showError);
|
||||
|
||||
// full screen support is buggy on Windows and Ubuntu.
|
||||
// require the FULLSCREEN_SUPPORT macro to enable it!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue