summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraaronp64 <aaronp.code@gmail.com>2024-04-13 14:03:29 -0400
committeraaronp64 <aaronp.code@gmail.com>2024-04-13 14:03:29 -0400
commit4ed51933f910b9dcfbe5b847c1d0b95e822fc0dd (patch)
treeaf26a4a0528f7915c38819217fc942bdc59b7ea1
parent2886511c181402f77d28e286efd25124354eb258 (diff)
downloadredot-engine-4ed51933f910b9dcfbe5b847c1d0b95e822fc0dd.tar.gz
Fix Window.hide() crash when force_native changed
Moved force_native = p_force_native assignment to after is_visible() check, to prevent value from changing after window is shown. Fixes #90609
-rw-r--r--scene/main/window.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index 65f1365e67..de6bc29f05 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -1215,10 +1215,10 @@ void Window::set_force_native(bool p_force_native) {
if (force_native == p_force_native) {
return;
}
- force_native = p_force_native;
if (is_visible() && !is_in_edited_scene_root()) {
- WARN_PRINT("Can't change \"force_native\" while a window is displayed. Consider hiding window before changing this value.");
+ ERR_FAIL_MSG("Can't change \"force_native\" while a window is displayed. Consider hiding window before changing this value.");
}
+ force_native = p_force_native;
}
bool Window::get_force_native() const {