diff options
| author | Tannin <devnull@localhost> | 2015-06-17 18:33:16 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-06-17 18:33:16 +0200 |
| commit | e31baf3ee6681373867e9a50f02cdbbad6027291 (patch) | |
| tree | 849f9a2ccc75fa9751704643ea2b56d0036c193e /src/main.cpp | |
| parent | 5dcfca7c9d83679b8e863e296687a6943a57a643 (diff) | |
- bugfix: MO crashed without error message when "bootstrapping" failed
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp index 549de4a9..295fb75a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -369,23 +369,29 @@ int main(int argc, char *argv[]) return 1;
}
- if (!bootstrap()) { // requires gameinfo to be initialised!
- return -1;
- }
+ QPixmap pixmap(":/MO/gui/splash");
+ QSplashScreen splash(pixmap);
+
+ try {
+ if (!bootstrap()) { // requires gameinfo to be initialised!
+ return -1;
+ }
- LogBuffer::init(100, QtDebugMsg, qApp->property("dataPath").toString() + "/logs/mo_interface.log");
+ LogBuffer::init(100, QtDebugMsg, qApp->property("dataPath").toString() + "/logs/mo_interface.log");
#if QT_VERSION >= 0x050000
- qDebug("ssl support: %d", QSslSocket::supportsSsl());
+ qDebug("ssl support: %d", QSslSocket::supportsSsl());
#endif
- qDebug("Working directory: %s", qPrintable(QDir::toNativeSeparators(QDir::currentPath())));
- qDebug("MO at: %s", qPrintable(QDir::toNativeSeparators(application.applicationDirPath())));
- QPixmap pixmap(":/MO/gui/splash");
- QSplashScreen splash(pixmap);
- splash.show();
+ qDebug("Working directory: %s", qPrintable(QDir::toNativeSeparators(QDir::currentPath())));
+ qDebug("MO at: %s", qPrintable(QDir::toNativeSeparators(application.applicationDirPath())));
+ splash.show();
- cleanupDir();
+ cleanupDir();
+ } catch (const std::exception &e) {
+ reportError(e.what());
+ return 1;
+ }
{ // extend path to include dll directory so plugins don't need a manifest
// (using AddDllDirectory would be an alternative to this but it seems fairly complicated esp.
|
