| 265 | } |
| 266 | |
| 267 | void Exit() { |
| 268 | if(g_MainApplication) { |
| 269 | g_MainApplication->Close(); |
| 270 | } |
| 271 | |
| 272 | romfsExit(); |
| 273 | |
| 274 | if(g_UpdatedNeedsRename) { |
| 275 | const auto cur_nro_file = __system_argv[0]; |
| 276 | auto sd_exp = fs::GetSdCardExplorer(); |
| 277 | sd_exp->DeleteFile(cur_nro_file); |
| 278 | sd_exp->RenameFile(GLEAF_PATH_TEMP_UPDATE_NRO, cur_nro_file); |
| 279 | } |
| 280 | |
| 281 | { |
| 282 | ScopedLock lk(g_LogLock); |
| 283 | for(auto &it : g_ThreadLogBufferList) { |
| 284 | delete[] it.second; |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | cnt::FinalizeTickets(); |
| 289 | cnt::FinalizeApplications(); |
| 290 | fs::Finalize(); |
| 291 | drive::Finalize(); |
| 292 | amssuExit(); |
| 293 | usb::Finalize(); |
| 294 | setsysExit(); |
| 295 | setExit(); |
| 296 | psmExit(); |
| 297 | esExit(); |
| 298 | nsExit(); |
| 299 | accountExit(); |
| 300 | ncmExit(); |
| 301 | nifmExit(); |
| 302 | pdmqryExit(); |
| 303 | |
| 304 | exit(0); |
| 305 | } |
| 306 | |
| 307 | char *GetLogBuffer() { |
| 308 | ScopedLock lk(g_LogLock); |
no test coverage detected