mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 08:21:29 +12:00
Support logger stopping at std::exit (#9722)
This commit is contained in:
parent
7e0fdbbe99
commit
7ce835e878
1 changed files with 5 additions and 6 deletions
|
@ -77,7 +77,7 @@ LOG_CHANNEL(q_debug, "QDEBUG");
|
||||||
const bool local = s_qt_init.try_lock();
|
const bool local = s_qt_init.try_lock();
|
||||||
|
|
||||||
// Possibly created and assigned here
|
// Possibly created and assigned here
|
||||||
QScopedPointer<QCoreApplication> app;
|
static QScopedPointer<QCoreApplication> app;
|
||||||
|
|
||||||
if (local)
|
if (local)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +110,6 @@ LOG_CHANNEL(q_debug, "QDEBUG");
|
||||||
{
|
{
|
||||||
// Since we only show an error, we can hope for a graceful exit
|
// Since we only show an error, we can hope for a graceful exit
|
||||||
show_report(text);
|
show_report(text);
|
||||||
app.reset();
|
|
||||||
std::exit(0);
|
std::exit(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -325,7 +324,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
const std::string lock_name = fs::get_cache_dir() + "RPCS3.buf";
|
const std::string lock_name = fs::get_cache_dir() + "RPCS3.buf";
|
||||||
|
|
||||||
fs::file instance_lock;
|
static fs::file instance_lock;
|
||||||
|
|
||||||
// True if an argument --updating found
|
// True if an argument --updating found
|
||||||
const bool is_updating = find_arg(arg_updating, argc, argv) != 0;
|
const bool is_updating = find_arg(arg_updating, argc, argv) != 0;
|
||||||
|
@ -374,7 +373,7 @@ int main(int argc, char** argv)
|
||||||
// Initialize thread pool finalizer (on first use)
|
// Initialize thread pool finalizer (on first use)
|
||||||
named_thread("", []{})();
|
named_thread("", []{})();
|
||||||
|
|
||||||
std::unique_ptr<logs::listener> log_file;
|
static std::unique_ptr<logs::listener> log_file;
|
||||||
{
|
{
|
||||||
// Check free space
|
// Check free space
|
||||||
fs::device_stat stats{};
|
fs::device_stat stats{};
|
||||||
|
@ -388,7 +387,7 @@ int main(int argc, char** argv)
|
||||||
log_file = logs::make_file_listener(fs::get_cache_dir() + "RPCS3.log", stats.avail_free / 4);
|
log_file = logs::make_file_listener(fs::get_cache_dir() + "RPCS3.log", stats.avail_free / 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<logs::listener> log_pauser = std::make_unique<pause_on_fatal>();
|
static std::unique_ptr<logs::listener> log_pauser = std::make_unique<pause_on_fatal>();
|
||||||
logs::listener::add(log_pauser.get());
|
logs::listener::add(log_pauser.get());
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -456,7 +455,7 @@ int main(int argc, char** argv)
|
||||||
app->setApplicationName("RPCS3");
|
app->setApplicationName("RPCS3");
|
||||||
|
|
||||||
// Command line args
|
// Command line args
|
||||||
QCommandLineParser parser;
|
static QCommandLineParser parser;
|
||||||
parser.setApplicationDescription("Welcome to RPCS3 command line.");
|
parser.setApplicationDescription("Welcome to RPCS3 command line.");
|
||||||
parser.addPositionalArgument("(S)ELF", "Path for directly executing a (S)ELF");
|
parser.addPositionalArgument("(S)ELF", "Path for directly executing a (S)ELF");
|
||||||
parser.addPositionalArgument("[Args...]", "Optional args for the executable");
|
parser.addPositionalArgument("[Args...]", "Optional args for the executable");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue