diff options
| author | 2024-01-27 14:39:55 -0500 | |
|---|---|---|
| committer | 2024-01-29 20:17:33 -0500 | |
| commit | 8e0a40434c8cc1de7b7262c0439380e5eca3e42a (patch) | |
| tree | 8c4c431ce094cc55b13bcfd917f5dd27e25dd754 /src | |
| parent | core: support offline web applet (diff) | |
| download | yuzu-8e0a40434c8cc1de7b7262c0439380e5eca3e42a.tar.gz yuzu-8e0a40434c8cc1de7b7262c0439380e5eca3e42a.tar.xz yuzu-8e0a40434c8cc1de7b7262c0439380e5eca3e42a.zip | |
am: stop emulation when all applets are closed
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/applet_manager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/service/am/applet_manager.cpp b/src/core/hle/service/am/applet_manager.cpp index a733525a2..52200d5b2 100644 --- a/src/core/hle/service/am/applet_manager.cpp +++ b/src/core/hle/service/am/applet_manager.cpp | |||
| @@ -221,6 +221,7 @@ void AppletManager::InsertApplet(std::shared_ptr<Applet> applet) { | |||
| 221 | 221 | ||
| 222 | void AppletManager::TerminateAndRemoveApplet(AppletResourceUserId aruid) { | 222 | void AppletManager::TerminateAndRemoveApplet(AppletResourceUserId aruid) { |
| 223 | std::shared_ptr<Applet> applet; | 223 | std::shared_ptr<Applet> applet; |
| 224 | bool should_stop = false; | ||
| 224 | { | 225 | { |
| 225 | std::scoped_lock lk{m_lock}; | 226 | std::scoped_lock lk{m_lock}; |
| 226 | 227 | ||
| @@ -231,10 +232,17 @@ void AppletManager::TerminateAndRemoveApplet(AppletResourceUserId aruid) { | |||
| 231 | 232 | ||
| 232 | applet = it->second; | 233 | applet = it->second; |
| 233 | m_applets.erase(it); | 234 | m_applets.erase(it); |
| 235 | |||
| 236 | should_stop = m_applets.empty(); | ||
| 234 | } | 237 | } |
| 235 | 238 | ||
| 236 | // Terminate process. | 239 | // Terminate process. |
| 237 | applet->process->Terminate(); | 240 | applet->process->Terminate(); |
| 241 | |||
| 242 | // If there were no applets left, stop emulation. | ||
| 243 | if (should_stop) { | ||
| 244 | m_system.Exit(); | ||
| 245 | } | ||
| 238 | } | 246 | } |
| 239 | 247 | ||
| 240 | void AppletManager::CreateAndInsertByFrontendAppletParameters( | 248 | void AppletManager::CreateAndInsertByFrontendAppletParameters( |