Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

macOS: Fix `r_error` not being set when failing to create main window

Aaron Franke56404b3215a3
diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm
index 2336f0dcec4..d81efbadfa5 100644
--- a/platform/macos/display_server_macos.mm
+++ b/platform/macos/display_server_macos.mm
@@ -4000,7 +4000,10 @@ DisplayServerMacOS::DisplayServerMacOS(const String &p_rendering_driver, Display
}
DisplayServerEnums::WindowID main_window = _create_window(p_mode, p_vsync_mode, Rect2i(window_position, p_resolution));
- ERR_FAIL_COND(main_window == DisplayServerEnums::INVALID_WINDOW_ID);
+ if (main_window == DisplayServerEnums::INVALID_WINDOW_ID) {
+ r_error = ERR_CANT_CREATE;
+ ERR_FAIL_MSG("Could not create main window.");
+ }
for (int i = 0; i < DisplayServerEnums::WINDOW_FLAG_MAX; i++) {
if (p_flags & (1 << i)) {
window_set_flag(DisplayServerEnums::WindowFlags(i), true, main_window);
diff --git a/platform/macos/gl_manager_macos_legacy.h b/platform/macos/gl_manager_macos_legacy.h
index 295a0a186a7..a12b9a13c7f 100644
--- a/platform/macos/gl_manager_macos_legacy.h
+++ b/platform/macos/gl_manager_macos_legacy.h
@@ -90,6 +90,6 @@ public:
~GLManagerLegacy_MacOS();
};
-GODOT_CLANG_WARNING_PUSH
+GODOT_CLANG_WARNING_POP
#endif // MACOS_ENABLED && GLES3_ENABLED