mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 07:02:30 +01:00
wrlib: Implemented functions to allow clean-up of Contexts
The function 'RDestroyContext' have been defined in the API for a long time but did not have an implementation, this patch fixes it.
This commit is contained in:
committed by
Carlos R. Mafra
parent
64e4019614
commit
283286e0cd
@@ -688,6 +688,21 @@ RContext *RCreateContext(Display * dpy, int screen_number, const RContextAttribu
|
||||
return context;
|
||||
}
|
||||
|
||||
void RDestroyContext(RContext *context)
|
||||
{
|
||||
if (context) {
|
||||
if (context->copy_gc)
|
||||
XFreeGC(context->dpy, context->copy_gc);
|
||||
if (context->attribs) {
|
||||
if ((context->attribs->flags & RC_VisualID) &&
|
||||
!(context->attribs->flags & RC_DefaultVisual))
|
||||
XDestroyWindow(context->dpy, context->drawable);
|
||||
free(context->attribs);
|
||||
}
|
||||
free(context);
|
||||
}
|
||||
}
|
||||
|
||||
static Bool bestContext(Display * dpy, int screen_number, RContext * context)
|
||||
{
|
||||
XVisualInfo *vinfo = NULL, rvinfo;
|
||||
|
||||
Reference in New Issue
Block a user