void OSXContext::_unregisterContext() { // NB have to do this is subclass to ensure any methods called back // are on this subclass and not half-destructed superclass GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem()); rs->_unregisterContext(this); }
GLXContext::~GLXContext() { GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem()); if (!mExternalContext) glXDestroyContext(mGLSupport->getGLDisplay(), mContext); rs->_unregisterContext(this); }