mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 03:32:55 +00:00
Fix "Exit RPCS3 when process finishes" command line crash
Added force_boot to force boot on cmdline boot. Load() caused a Stop() that exited the application with "Exit RPCS3 when process finishes" enabled. Now Stop is only called if the emu is not stopped
This commit is contained in:
parent
dd5791a2cc
commit
de465cb941
@ -281,9 +281,17 @@ std::string Emulator::GetLibDir()
|
||||
return fmt::replace_all(g_cfg.vfs.dev_flash, "$(EmulatorDir)", emu_dir) + "sys/external/";
|
||||
}
|
||||
|
||||
void Emulator::SetForceBoot(bool force_boot)
|
||||
{
|
||||
m_force_boot = force_boot;
|
||||
}
|
||||
|
||||
void Emulator::Load(bool add_only)
|
||||
{
|
||||
Stop();
|
||||
if (!IsStopped())
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@ -616,9 +624,10 @@ void Emulator::Load(bool add_only)
|
||||
return;
|
||||
}
|
||||
|
||||
if (g_cfg.misc.autostart && IsReady())
|
||||
if ((m_force_boot || g_cfg.misc.autostart) && IsReady())
|
||||
{
|
||||
Run();
|
||||
m_force_boot = false;
|
||||
}
|
||||
else if (IsPaused())
|
||||
{
|
||||
|
@ -182,6 +182,8 @@ class Emulator final
|
||||
std::string m_title_id;
|
||||
std::string m_title;
|
||||
|
||||
bool m_force_boot = false;
|
||||
|
||||
public:
|
||||
Emulator() = default;
|
||||
|
||||
@ -247,6 +249,8 @@ public:
|
||||
static std::string GetHddDir();
|
||||
static std::string GetLibDir();
|
||||
|
||||
void SetForceBoot(bool force_boot);
|
||||
|
||||
void Load(bool add_only = false);
|
||||
void Run();
|
||||
bool Pause();
|
||||
|
@ -74,8 +74,8 @@ int main(int argc, char** argv)
|
||||
QTimer::singleShot(2, [path = sstr(QFileInfo(args.at(0)).canonicalFilePath()), argv = std::move(argv)]() mutable
|
||||
{
|
||||
Emu.argv = std::move(argv);
|
||||
Emu.SetForceBoot(true);
|
||||
Emu.BootGame(path, true);
|
||||
Emu.Run();
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user