From e5ce7e763d7d23588312ea635eea8c0db235db00 Mon Sep 17 00:00:00 2001 From: Hannu Koivisto Date: Sat, 11 Mar 2023 18:44:04 +0200 Subject: [PATCH] [Draft] Mitigate crash in Draft_Edit (#8749) (#8750) This mitigates the crash reported in issue #8749. The crash happens when using Draft_Edit and using keyboard to enter a coordinate in Edit node dialog. This change partially restores behaviour before commit b45258b, after which FreeCADGui.Control.closeDialog and showDialog calls during execution of DraftToolBar.editUi are no longer made using the todo.delay mechanism. The crash can still be triggered by artificially slowing down key event processing, so this is not a proper fix, just a mitigation. --- src/Mod/Draft/DraftGui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index 07b879c155..ea19cd31b9 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -1070,9 +1070,9 @@ class DraftToolBar: if self.callback: self.callback() return True - FreeCADGui.Control.closeDialog() + todo.delay(FreeCADGui.Control.closeDialog,None) panel = TaskPanel(extra, on_close_call) - FreeCADGui.Control.showDialog(panel) + todo.delay(FreeCADGui.Control.showDialog,panel) #---------------------------------------------------------------------------