Remove nvidia workaround
This commit is contained in:
parent
d2ef0a996f
commit
1c911575fa
41
src/main.cpp
41
src/main.cpp
@ -145,7 +145,6 @@ int main(int argc, char* argv[]) {
|
|||||||
qLog(Info) << "Strawberry is already running - activating existing window (1)";
|
qLog(Info) << "Strawberry is already running - activating existing window (1)";
|
||||||
}
|
}
|
||||||
if (core_app.sendMessage(options.Serialize(), 5000)) {
|
if (core_app.sendMessage(options.Serialize(), 5000)) {
|
||||||
main_exit_safe(0);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// Couldn't send the message so start anyway
|
// 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)";
|
qLog(Info) << "Strawberry is already running - activating existing window (2)";
|
||||||
}
|
}
|
||||||
if (a.sendMessage(options.Serialize(), 5000)) {
|
if (a.sendMessage(options.Serialize(), 5000)) {
|
||||||
main_exit_safe(0);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// Couldn't send the message so start anyway
|
// Couldn't send the message so start anyway
|
||||||
@ -270,44 +268,5 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
int ret = a.exec();
|
int ret = a.exec();
|
||||||
|
|
||||||
//main_exit_safe(ret);
|
|
||||||
|
|
||||||
return 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
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -23,6 +23,5 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[]);
|
int main(int argc, char* argv[]);
|
||||||
void main_exit_safe(int ret);
|
|
||||||
|
|
||||||
#endif // MAIN_H
|
#endif // MAIN_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user