void OpenGLModule::unregisterGLWidget(GtkWidget* widget) { assert(_realisedGLWidgets > 0); if (--_realisedGLWidgets == 0) { // This was the last active GL widget contextValid = false; sharedContextDestroyed(); gtk_widget_unref(_sharedContext); _sharedContext = NULL; } }
void OpenGLModule::unregisterGLCanvas(wxutil::GLWidget* widget) { wxGLWidgets::iterator found = _wxGLWidgets.find(widget); assert(found != _wxGLWidgets.end()); if (found != _wxGLWidgets.end()) { if (_wxGLWidgets.size() == 1) { // This is the last active GL widget _wxContextValid = false; sharedContextDestroyed(); delete _wxSharedContext; _wxSharedContext = NULL; } _wxGLWidgets.erase(found); } }