mirror of
https://github.com/wiiu-env/EnvironmentLoader.git
synced 2024-12-27 21:41:56 +01:00
Properly deinit logging, call missing __fini(), return instead of calling _Exit(0);
This commit is contained in:
parent
fb5f06064e
commit
2e44af129e
2
Makefile
2
Makefile
@ -31,7 +31,7 @@ INCLUDES := source
|
||||
#-------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
#-------------------------------------------------------------------------------
|
||||
CFLAGS := -g -Wall -O3 -ffunction-sections -fno-exceptions -fno-rtti\
|
||||
CFLAGS := -g -Wall -O2 -ffunction-sections -fno-exceptions -fno-rtti\
|
||||
$(MACHDEP)
|
||||
|
||||
CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
|
||||
|
@ -86,11 +86,19 @@ bool writeFileContent(const std::string &path, const std::string &content) {
|
||||
return false;
|
||||
}
|
||||
|
||||
extern "C" void __fini();
|
||||
|
||||
#ifdef DEBUG
|
||||
bool module_log = false;
|
||||
bool udp_log = false;
|
||||
bool cafe_log = false;
|
||||
#endif // DEBUG
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef DEBUG
|
||||
if (!WHBLogModuleInit()) {
|
||||
WHBLogCafeInit();
|
||||
WHBLogUdpInit();
|
||||
if (!(module_log = WHBLogModuleInit())) {
|
||||
cafe_log = WHBLogCafeInit();
|
||||
udp_log = WHBLogUdpInit();
|
||||
}
|
||||
#endif // DEBUG
|
||||
|
||||
@ -230,7 +238,12 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
ProcUIShutdown();
|
||||
|
||||
_Exit(0);
|
||||
#ifdef DEBUG
|
||||
if (module_log) { WHBLogModuleDeinit(); }
|
||||
if (udp_log) { WHBLogUdpDeinit(); }
|
||||
if (cafe_log) { WHBLogCafeDeinit(); }
|
||||
#endif // DEBUG
|
||||
__fini();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user