Windows execution fixes

This commit is contained in:
Christophe Dumez 2010-05-30 17:51:40 +00:00
parent 58a36f7cfd
commit 338d4fd31e
11 changed files with 164 additions and 53 deletions

View file

@ -168,6 +168,13 @@ void useStyle(QApplication *app, QString style){
// Main
int main(int argc, char *argv[]){
// Create Application
#ifdef DISABLE_GUI
app = new QCoreApplication(argc, argv);
#else
app = new QApplication(argc, argv);
#endif
QString locale;
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent"));
#ifndef DISABLE_GUI
@ -208,16 +215,10 @@ int main(int argc, char *argv[]){
std::cout << "disconnected\n";
}
localSocket.close();
delete app;
return 0;
}
// Create Application
#ifdef DISABLE_GUI
app = new QCoreApplication(argc, argv);
#else
app = new QApplication(argc, argv);
#endif
// Load translation
locale = settings.value(QString::fromUtf8("Preferences/General/Locale"), QString()).toString();
QTranslator translator;
@ -341,7 +342,10 @@ int main(int argc, char *argv[]){
delete loader;
#endif
qDebug("Deleting app...");
#ifndef Q_WS_WIN
// XXX: Why does it crash on Windows!?
delete app;
#endif
qDebug("App was deleted! All good.");
return ret;
}