From 0c6f089ce4068c02514261c8a40e231c3779b9d5 Mon Sep 17 00:00:00 2001 From: sanikoyes Date: Tue, 22 Mar 2016 12:46:33 +0800 Subject: [PATCH] Fix GDScript crash when call show/hide in func _exit_tree --- scene/gui/control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index d7befd6e11d..cb6abc71239 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -525,8 +525,8 @@ void Control::_notification(int p_notification) { if (!is_visible()) { - - get_viewport()->_gui_hid_control(this); + if(get_viewport() != NULL) + get_viewport()->_gui_hid_control(this); _modal_stack_remove(); minimum_size_changed();