mirror of
https://github.com/wiiu-env/EnvironmentLoader.git
synced 2024-11-30 09:24:14 +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
|
# 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)
|
$(MACHDEP)
|
||||||
|
|
||||||
CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
|
CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
|
||||||
|
@ -86,11 +86,19 @@ bool writeFileContent(const std::string &path, const std::string &content) {
|
|||||||
return false;
|
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) {
|
int main(int argc, char **argv) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (!WHBLogModuleInit()) {
|
if (!(module_log = WHBLogModuleInit())) {
|
||||||
WHBLogCafeInit();
|
cafe_log = WHBLogCafeInit();
|
||||||
WHBLogUdpInit();
|
udp_log = WHBLogUdpInit();
|
||||||
}
|
}
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
@ -230,7 +238,12 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
ProcUIShutdown();
|
ProcUIShutdown();
|
||||||
|
|
||||||
_Exit(0);
|
#ifdef DEBUG
|
||||||
|
if (module_log) { WHBLogModuleDeinit(); }
|
||||||
|
if (udp_log) { WHBLogUdpDeinit(); }
|
||||||
|
if (cafe_log) { WHBLogCafeDeinit(); }
|
||||||
|
#endif // DEBUG
|
||||||
|
__fini();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user