GraphicsContext3D::~GraphicsContext3D() { if (m_private->renderStyle() == RenderToCurrentGLContext) return; makeContextCurrent(); if (m_texture) ::glDeleteTextures(1, &m_texture); if (m_compositorTexture) ::glDeleteTextures(1, &m_compositorTexture); if (m_attrs.antialias) { ::glDeleteRenderbuffers(1, &m_multisampleColorBuffer); if (m_attrs.stencil || m_attrs.depth) ::glDeleteRenderbuffers(1, &m_multisampleDepthStencilBuffer); ::glDeleteFramebuffers(1, &m_multisampleFBO); } else { if (m_attrs.stencil || m_attrs.depth) ::glDeleteRenderbuffers(1, &m_depthStencilBuffer); } ::glDeleteFramebuffers(1, &m_fbo); #if USE(COORDINATED_GRAPHICS_THREADED) ::glDeleteTextures(1, &m_intermediateTexture); #endif if (m_vao) deleteVertexArray(m_vao); }
Context::~Context() { mState.reset(); while (!mFramebufferMap.empty()) { // Delete the framebuffer in reverse order to destroy the framebuffer zero last. deleteFramebuffer(mFramebufferMap.rbegin()->first); } while (!mFenceNVMap.empty()) { deleteFenceNV(mFenceNVMap.begin()->first); } while (!mQueryMap.empty()) { deleteQuery(mQueryMap.begin()->first); } while (!mVertexArrayMap.empty()) { deleteVertexArray(mVertexArrayMap.begin()->first); } mTransformFeedbackZero.set(NULL); while (!mTransformFeedbackMap.empty()) { deleteTransformFeedback(mTransformFeedbackMap.begin()->first); } for (auto &zeroTexture : mZeroTextures) { zeroTexture.second.set(NULL); } mZeroTextures.clear(); if (mResourceManager) { mResourceManager->release(); } SafeDelete(mCompiler); }