Fix GL assertion failure during GAL teardown
This commit is contained in:
parent
3854637ec5
commit
11f4622ea5
|
@ -2,6 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -78,7 +79,12 @@ void GL_CONTEXT_MANAGER::LockCtx( wxGLContext* aContext, wxGLCanvas* aCanvas )
|
|||
m_glCtxMutex.lock();
|
||||
wxGLCanvas* canvas = aCanvas ? aCanvas : m_glContexts.at( aContext );
|
||||
|
||||
// Prevent assertion failure in wxGLContext::SetCurrent during GAL teardown
|
||||
if( canvas->GetXWindow() )
|
||||
{
|
||||
canvas->SetCurrent( *aContext );
|
||||
}
|
||||
|
||||
m_glCtx = aContext;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue