From 28a915d821f0bf990eee49eec711630fb8713934 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 1 Oct 2019 16:34:51 +0200 Subject: [PATCH] =?UTF-8?q?when=20closing=20a=203d=20view=20check=20if=20i?= =?UTF-8?q?t=C3=84s=20in=20edit=20mode=20to=20avoid=20to=20leave=20a=20vie?= =?UTF-8?q?w=20provider=20in=20a=20broken=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Gui/View3DInventorViewer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 5f30e28c47..d52a081b25 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -608,6 +608,14 @@ View3DInventorViewer::~View3DInventorViewer() // to prevent following OpenGL error message: "Texture is not valid in the current context. Texture has not been destroyed" aboutToDestroyGLContext(); + // It can happen that a document has several MDI views and when the about to be + // closed 3D view is in edit mode the corresponding view provider must be restored + // because otherwise it might be left in a broken state + // See https://forum.freecadweb.org/viewtopic.php?f=3&t=39720 + if (restoreEditingRoot) { + resetEditingRoot(false); + } + // cleanup this->backgroundroot->unref(); this->backgroundroot = 0;