From 9e4c1da0328c98e90792d56265f709e974e0ff51 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Fri, 20 Jun 2025 19:42:30 -0500 Subject: [PATCH 1/2] Clear entries and pending entries before play for debug log. --- Source/Editor/Windows/DebugLogWindow.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Editor/Windows/DebugLogWindow.cs b/Source/Editor/Windows/DebugLogWindow.cs index b5d71f6a0..36a7ffa82 100644 --- a/Source/Editor/Windows/DebugLogWindow.cs +++ b/Source/Editor/Windows/DebugLogWindow.cs @@ -735,11 +735,15 @@ namespace FlaxEditor.Windows } /// - public override void OnPlayBegin() + public override void OnPlayBeginning() { // Clear on Play - if (_clearOnPlayButton.Checked) + if (Editor.Options.Options.Interface.DebugLogClearOnPlay) { + lock (_locker) + { + _pendingEntries?.Clear(); + } Clear(); } } From 78f0ff75f29348b8df21f071b286314f977d8394 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 1 Jul 2025 10:52:04 +0200 Subject: [PATCH 2/2] Move debug log clearing to handle pending entries too in publci api --- Source/Editor/Windows/DebugLogWindow.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Editor/Windows/DebugLogWindow.cs b/Source/Editor/Windows/DebugLogWindow.cs index 36a7ffa82..ed133d4e8 100644 --- a/Source/Editor/Windows/DebugLogWindow.cs +++ b/Source/Editor/Windows/DebugLogWindow.cs @@ -447,6 +447,10 @@ namespace FlaxEditor.Windows /// public void Clear() { + lock (_locker) + { + _pendingEntries.Clear(); + } if (_entriesPanel == null) return; RemoveEntries(); @@ -740,10 +744,6 @@ namespace FlaxEditor.Windows // Clear on Play if (Editor.Options.Options.Interface.DebugLogClearOnPlay) { - lock (_locker) - { - _pendingEntries?.Clear(); - } Clear(); } }