Revert commit "Make fatalMessageBox() end with std::abort() [...]"
This reverts commit9e6a3ebc6b
("Make fatalMessageBox() end with std::abort() and declare it [[noreturn]]"). After reflexion, it seems better to let fatalMessageBox() return, because there is existing code that appears to be relying on this aspect to do some work after having called fatalMessageBox() (cf. main() in bootstrap.cxx). Also, the way of exiting from fatalMessageBox() after commit9e6a3ebc6b
(std::abort()) was probably too brutal for a controlled exit---as opposed to a terminate handler.
This commit is contained in:
parent
09dd24c139
commit
680f940378
3 changed files with 10 additions and 11 deletions
|
@ -148,16 +148,16 @@ MessageBoxResult modalMessageBox(const std::string& caption,
|
|||
#endif
|
||||
}
|
||||
|
||||
[[noreturn]] void fatalMessageBox(const std::string& caption,
|
||||
MessageBoxResult fatalMessageBox(const std::string& caption,
|
||||
const std::string& msg,
|
||||
const std::string& moreText)
|
||||
{
|
||||
#if defined(SG_WINDOWS)
|
||||
win32MessageBox(caption, msg, moreText);
|
||||
return win32MessageBox(caption, msg, moreText);
|
||||
#elif defined(SG_MAC)
|
||||
cocoaFatalMessage(msg, moreText);
|
||||
return cocoaFatalMessage(msg, moreText);
|
||||
#elif defined(HAVE_QT)
|
||||
QtMessageBox(caption, msg, moreText, true);
|
||||
return QtMessageBox(caption, msg, moreText, true);
|
||||
#else
|
||||
std::string s = "FATAL: "+ msg;
|
||||
if (!moreText.empty()) {
|
||||
|
@ -171,9 +171,8 @@ MessageBoxResult modalMessageBox(const std::string& caption,
|
|||
dlg->setStringValue("text/label", s );
|
||||
_gui->showDialog("popup");
|
||||
}
|
||||
return MSG_BOX_OK;
|
||||
#endif
|
||||
|
||||
std::abort();
|
||||
}
|
||||
|
||||
} // of namespace flightgear
|
||||
|
|
|
@ -17,7 +17,7 @@ MessageBoxResult modalMessageBox(const std::string& caption,
|
|||
const std::string& msg,
|
||||
const std::string& moreText = std::string());
|
||||
|
||||
[[noreturn]] void fatalMessageBox(const std::string& caption,
|
||||
MessageBoxResult fatalMessageBox(const std::string& caption,
|
||||
const std::string& msg,
|
||||
const std::string& moreText = std::string());
|
||||
|
||||
|
|
|
@ -113,11 +113,11 @@ namespace flightgear
|
|||
return MSG_BOX_OK;
|
||||
}
|
||||
|
||||
[[noreturn]] void fatalMessageBox(const std::string& caption,
|
||||
MessageBoxResult fatalMessageBox(const std::string& caption,
|
||||
const std::string& msg,
|
||||
const std::string& moreText)
|
||||
{
|
||||
std::abort();
|
||||
return MSG_BOX_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue