when closing a 3d view check if itÄs in edit mode to avoid to leave a view provider in a broken state

This commit is contained in:
wmayer
2019-10-01 16:34:51 +02:00
parent 2a3d398a9b
commit 28a915d821

View File

@@ -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;