From d8ca03b362d9c554493f16deea2bebf0c65687b6 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 9 May 2016 17:59:59 +0200 Subject: [PATCH] 3D viewer: set right OpenGL context before freeing memory. --- 3d-viewer/3d_canvas.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/3d-viewer/3d_canvas.cpp b/3d-viewer/3d_canvas.cpp index 1056724785..2176aa9c76 100644 --- a/3d-viewer/3d_canvas.cpp +++ b/3d-viewer/3d_canvas.cpp @@ -116,6 +116,13 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) : EDA_3D_CANVAS::~EDA_3D_CANVAS() { +#ifdef __LINUX__ + if( IsShownOnScreen() ) + SetCurrent( *m_glRC ); +#else + SetCurrent( *m_glRC ); +#endif + ClearLists(); m_init = false; delete m_glRC;