mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 23:42:16 +00:00
Added [XGScreenContext dealloc] to clean up RContext.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@17238 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
28bab0e371
commit
de73d6ad60
1 changed files with 25 additions and 0 deletions
|
@ -254,6 +254,31 @@ _parse_display_name(NSString *name, int *dn, int *sn)
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
// FIXME: context.c does not include a clean up function for Rcontext,
|
||||
// so we try do it here.
|
||||
if (rcontext)
|
||||
{
|
||||
XFreeGC(rcontext->dpy, rcontext->copy_gc);
|
||||
if (rcontext->drawable)
|
||||
{
|
||||
XDestroyWindow(rcontext->dpy, rcontext->drawable);
|
||||
}
|
||||
if (rcontext->pixels)
|
||||
{
|
||||
free(rcontext->pixels);
|
||||
}
|
||||
if (rcontext->colors)
|
||||
{
|
||||
free(rcontext->colors);
|
||||
}
|
||||
free(rcontext->attribs);
|
||||
free(rcontext);
|
||||
}
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (XGDrawMechanism) drawMechanism
|
||||
{
|
||||
return drawMechanism;
|
||||
|
|
Loading…
Reference in a new issue