Skip to content

Commit

Permalink
Reduce uMenu's heap, fix application exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
XorTroll committed Sep 23, 2021
1 parent 54b228f commit 10e1ab3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Atmosphere-libs
Submodule Atmosphere-libs updated 424 files
2 changes: 1 addition & 1 deletion Plutonium
Submodule Plutonium updated 1 files
+1 −9 .github/FUNDING.yml
2 changes: 1 addition & 1 deletion uDaemon/source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void __appInit() {
void __appExit() {
// qlaunch should not terminate, so this is considered an invalid system state
// am would fatal otherwise
fatalThrow(0xDEADBABE);
UL_ASSERT(0xDEADBABE);
}

namespace {
Expand Down
10 changes: 9 additions & 1 deletion uLaunch/source/am/am_Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,30 @@ namespace am {
extern bool g_DaemonHasFocus;

bool ApplicationIsActive() {
if(g_ApplicationHolder.StateChangedEvent.revent == INVALID_HANDLE) {
if(!eventActive(&g_ApplicationHolder.StateChangedEvent)) {
return false;
}
if(!serviceIsActive(&g_ApplicationHolder.s)) {
return false;
}

return !appletApplicationCheckFinished(&g_ApplicationHolder);
}

void ApplicationTerminate() {
appletApplicationRequestExit(&g_ApplicationHolder);

// Wait until it's actually exited
while(ApplicationIsActive()) {
svcSleepThread(10'000'000);
}

g_DaemonHasFocus = true;
}

Result ApplicationStart(u64 app_id, bool system, AccountUid user_id, void *data, size_t size) {
appletApplicationClose(&g_ApplicationHolder);

if(system) {
R_TRY(appletCreateSystemApplication(&g_ApplicationHolder, app_id));
}
Expand Down
2 changes: 1 addition & 1 deletion uMenu/source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {
u32 __nx_applet_type = AppletType_LibraryApplet; // Explicitly declare we're a library applet (need to do so for non-hbloader homebrew)
TimeServiceType __nx_time_service_type = TimeServiceType_System;
u32 __nx_fs_num_sessions = 1;
size_t __nx_heap_size = 0xC000000;
size_t __nx_heap_size = 0xB000000;

}

Expand Down

0 comments on commit 10e1ab3

Please sign in to comment.