1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-18 11:39:31 +01:00

Remove nvidia workaround

This commit is contained in:
Jonas Kvinge 2019-04-23 19:18:50 +02:00
parent d2ef0a996f
commit 1c911575fa
2 changed files with 0 additions and 42 deletions

View File

@ -145,7 +145,6 @@ int main(int argc, char* argv[]) {
qLog(Info) << "Strawberry is already running - activating existing window (1)";
}
if (core_app.sendMessage(options.Serialize(), 5000)) {
main_exit_safe(0);
return 0;
}
// Couldn't send the message so start anyway
@ -175,7 +174,6 @@ int main(int argc, char* argv[]) {
qLog(Info) << "Strawberry is already running - activating existing window (2)";
}
if (a.sendMessage(options.Serialize(), 5000)) {
main_exit_safe(0);
return 0;
}
// Couldn't send the message so start anyway
@ -270,44 +268,5 @@ int main(int argc, char* argv[]) {
int ret = a.exec();
//main_exit_safe(ret);
return ret;
}
void main_exit_safe(int ret) {
#ifdef Q_OS_LINUX
bool have_nvidia = false;
QFile proc_modules("/proc/modules");
if (proc_modules.open(QIODevice::ReadOnly)) {
forever {
QByteArray line = proc_modules.readLine();
if (line.startsWith("nvidia ") || line.startsWith("nvidia_")) {
have_nvidia = true;
}
if (proc_modules.atEnd()) break;
}
proc_modules.close();
}
QFile self_maps("/proc/self/maps");
if (self_maps.open(QIODevice::ReadOnly)) {
forever {
QByteArray line = self_maps.readLine();
if (line.startsWith("libnvidia-")) {
have_nvidia = true;
}
if (self_maps.atEnd()) break;
}
self_maps.close();
}
if (have_nvidia) {
qLog(Warning) << "Exiting immediately to work around NVIDIA driver bug.";
_exit(ret);
}
#endif
}

View File

@ -23,6 +23,5 @@
#include "config.h"
int main(int argc, char* argv[]);
void main_exit_safe(int ret);
#endif // MAIN_H