|
KiCad PCB EDA Suite
|
Mark a scope whose GL objects have lost the context that owns them. More...
#include <orphaned_gl_objects.h>
Public Member Functions | |
| ORPHANED_GL_OBJECTS () | |
| ~ORPHANED_GL_OBJECTS () | |
Static Public Member Functions | |
| static bool | Active () |
Private Attributes | |
| bool | m_wasOrphaned |
Static Private Attributes | |
| static bool | s_orphaned = false |
Mark a scope whose GL objects have lost the context that owns them.
Deleting a GL object requires its own context to be current. A canvas whose native window is already gone cannot make its context current, and every 3D canvas owns an unshared context, so a delete issued then would be executed against whichever context is current and would destroy an unrelated object carrying the same name. Names are released when the owning context is destroyed, so skipping the deletes leaks nothing.
Only the thread holding the context issues GL commands, so no locking is needed here.
Definition at line 34 of file orphaned_gl_objects.h.
|
inline |
Definition at line 37 of file orphaned_gl_objects.h.
References m_wasOrphaned, and s_orphaned.
|
inline |
Definition at line 43 of file orphaned_gl_objects.h.
References m_wasOrphaned, and s_orphaned.
|
inlinestatic |
Definition at line 51 of file orphaned_gl_objects.h.
References s_orphaned.
Referenced by RENDER_3D_RAYTRACE_GL::deletePbo(), RENDER_3D_OPENGL::freeAllLists(), MODEL_3D::~MODEL_3D(), OPENGL_RENDER_LIST::~OPENGL_RENDER_LIST(), and RENDER_3D_OPENGL::~RENDER_3D_OPENGL().
|
private |
Definition at line 57 of file orphaned_gl_objects.h.
Referenced by ORPHANED_GL_OBJECTS(), and ~ORPHANED_GL_OBJECTS().
|
inlinestaticprivate |
Definition at line 58 of file orphaned_gl_objects.h.
Referenced by Active(), ORPHANED_GL_OBJECTS(), and ~ORPHANED_GL_OBJECTS().