mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 13:49:54 +00:00
[macOS] Fix profiler cleanup.
This commit is contained in:
parent
63e14e13f9
commit
0cc15abfae
2 changed files with 5 additions and 3 deletions
|
|
@ -132,6 +132,8 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
os->run();
|
os->run();
|
||||||
|
|
||||||
|
// Note: `os->run()` will never return if `OS_MacOS_NSApp` is used. Use `OS_MacOS_NSApp::cleanup()` for cleanup.
|
||||||
|
|
||||||
int exit_code = os->get_exit_code();
|
int exit_code = os->get_exit_code();
|
||||||
|
|
||||||
memdelete(os);
|
memdelete(os);
|
||||||
|
|
|
||||||
|
|
@ -1076,7 +1076,7 @@ OS_MacOS::OS_MacOS(const char *p_execpath, int p_argc, char **p_argv) {
|
||||||
// MARK: - OS_MacOS_NSApp
|
// MARK: - OS_MacOS_NSApp
|
||||||
|
|
||||||
void OS_MacOS_NSApp::run() {
|
void OS_MacOS_NSApp::run() {
|
||||||
[NSApp run];
|
[NSApp run]; // Note: this call will never return. Use `OS_MacOS_NSApp::cleanup()` for cleanup.
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sig_received = false;
|
static bool sig_received = false;
|
||||||
|
|
@ -1154,8 +1154,7 @@ void OS_MacOS_NSApp::start_main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OS_MacOS_NSApp::terminate() {
|
void OS_MacOS_NSApp::terminate() {
|
||||||
godot_cleanup_profiler();
|
// Note: This method only sends app termination request. Use `OS_MacOS_NSApp::cleanup()` for cleanup.
|
||||||
|
|
||||||
if (pre_wait_observer) {
|
if (pre_wait_observer) {
|
||||||
CFRunLoopRemoveObserver(CFRunLoopGetCurrent(), pre_wait_observer, kCFRunLoopCommonModes);
|
CFRunLoopRemoveObserver(CFRunLoopGetCurrent(), pre_wait_observer, kCFRunLoopCommonModes);
|
||||||
CFRelease(pre_wait_observer);
|
CFRelease(pre_wait_observer);
|
||||||
|
|
@ -1175,6 +1174,7 @@ void OS_MacOS_NSApp::cleanup() {
|
||||||
Main::cleanup();
|
Main::cleanup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
godot_cleanup_profiler();
|
||||||
}
|
}
|
||||||
|
|
||||||
OS_MacOS_NSApp::OS_MacOS_NSApp(const char *p_execpath, int p_argc, char **p_argv) :
|
OS_MacOS_NSApp::OS_MacOS_NSApp(const char *p_execpath, int p_argc, char **p_argv) :
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue