void glx_free(void *arg) { struct state_glx *context = (struct state_glx *) arg; Display *display = NULL; assert(context->magic == GLX_MAGIC); x11_lock(); #ifdef HAVE_GPUPERFAPI GPA_CloseContext(); #endif display = x11_get_display(); if(!display) { fprintf(stderr, "Unable to get shared display for GLX!\n"); x11_unlock(); } glXMakeCurrent( display, context->win, context->ctx ); glXDestroyContext( display, context->ctx ); fprintf(stderr, "GLX context destroyed\n"); #ifdef HAVE_GPUPERFAPI GPA_Destroy(); #endif XDestroyWindow( display, context->win ); XFreeColormap( display, context->cmap ); x11_release_display(); free(context); x11_unlock(); }
void Profiler::release() { GPA_CloseContext(); GPA_Destroy(); }