mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Hopefully a workaround for crashes and hang ups at closing on Windows.
Release the OpenGL contexts not by a destructor of a static class, but explicitely (predictively).
This commit is contained in:
parent
c6604ff55d
commit
0de566e2a2
5 changed files with 22 additions and 6 deletions
|
@ -197,11 +197,7 @@ GLCanvas3DManager::GLCanvas3DManager()
|
|||
|
||||
GLCanvas3DManager::~GLCanvas3DManager()
|
||||
{
|
||||
if (m_context != nullptr)
|
||||
{
|
||||
delete m_context;
|
||||
m_context = nullptr;
|
||||
}
|
||||
this->destroy();
|
||||
}
|
||||
|
||||
bool GLCanvas3DManager::add(wxGLCanvas* canvas, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar)
|
||||
|
@ -282,6 +278,15 @@ bool GLCanvas3DManager::init(wxGLCanvas* canvas)
|
|||
return false;
|
||||
}
|
||||
|
||||
void GLCanvas3DManager::destroy()
|
||||
{
|
||||
if (m_context != nullptr)
|
||||
{
|
||||
delete m_context;
|
||||
m_context = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
GLCanvas3D* GLCanvas3DManager::get_canvas(wxGLCanvas* canvas)
|
||||
{
|
||||
CanvasesMap::const_iterator it = do_get_canvas(canvas);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue