Skip to content

Commit

Permalink
Create QTranslator instances on heap (fixes #4311)
Browse files Browse the repository at this point in the history
- before these objects were destroyed when OMEditApplication's constructor is finished
- this caused OMEdit to crash after start with Qt 5.8
  • Loading branch information
spinnau authored and adeas31 committed Mar 16, 2017
1 parent 5c437fc commit e4e392f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions OMEdit/OMEditGUI/OMEditApplication.cpp
Expand Up @@ -89,17 +89,17 @@ OMEditApplication::OMEditApplication(int &argc, char **argv)

QString translationDirectory = omhome + QString("/share/omedit/nls");
// install Qt's default translations
QTranslator qtTranslator;
QTranslator *qtTranslator = new QTranslator(this);
#ifdef Q_OS_WIN
qtTranslator.load("qt_" + locale, translationDirectory);
qtTranslator->load("qt_" + locale, translationDirectory);
#else
qtTranslator.load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
qtTranslator->load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
#endif
installTranslator(&qtTranslator);
installTranslator(qtTranslator);
// install application translations
QTranslator translator;
translator.load("OMEdit_" + locale, translationDirectory);
installTranslator(&translator);
QTranslator *translator = new QTranslator(this);
translator->load("OMEdit_" + locale, translationDirectory);
installTranslator(translator);
// Splash Screen
QPixmap pixmap(":/Resources/icons/omedit_splashscreen.png");
SplashScreen *pSplashScreen = SplashScreen::instance();
Expand Down

0 comments on commit e4e392f

Please sign in to comment.