From 9742a161b30c291385885d8f0740a81a6fad9ca8 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 6 Oct 2019 04:57:38 +0100 Subject: [PATCH] Clear _focused_window in window destructor before calling OnFocuLost This is such that EditBoxInGlobalFocus does not return true within any OnFocusLost handlers --- src/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.cpp b/src/window.cpp index 220f7ca15f..1d7a371428 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -1092,8 +1092,8 @@ Window::~Window() /* Make sure we don't try to access this window as the focused window when it doesn't exist anymore. */ if (_focused_window == this) { - this->OnFocusLost(nullptr); _focused_window = nullptr; + this->OnFocusLost(nullptr); } this->DeleteChildWindows();