fix static gc for multipel servers

SVN revision: 3195
This commit is contained in:
Carsten Haitzler 2000-08-20 21:54:21 +00:00
parent 1896e7b45e
commit ec7148bb2b
1 changed files with 10 additions and 0 deletions

View File

@ -35,6 +35,7 @@ __imlib_RenderImage(Display *d, ImlibImage *im,
Context *ct; Context *ct;
DATA32 *buf = NULL, *pointer = NULL, *back = NULL; DATA32 *buf = NULL, *pointer = NULL, *back = NULL;
int y, h, hh, jump; int y, h, hh, jump;
static Display *disp = NULL;
static GC gc = 0; static GC gc = 0;
static GC gcm = 0; static GC gcm = 0;
XGCValues gcv; XGCValues gcv;
@ -238,9 +239,18 @@ __imlib_RenderImage(Display *d, ImlibImage *im,
if (buf) free(buf); if (buf) free(buf);
if (scaleinfo) __imlib_FreeScaleInfo(scaleinfo); if (scaleinfo) __imlib_FreeScaleInfo(scaleinfo);
if (back) free(back); if (back) free(back);
/* if we changed diplays since last time... free old gc's */
if (disp != d)
{
if (gc) XFreeGC(disp, gc);
if (gcm) XFreeGC(disp, gcm);
gc = 0;
gcm = 0;
}
/* if we didnt have a gc... create it */ /* if we didnt have a gc... create it */
if (!gc) if (!gc)
{ {
disp = d;
gcv.graphics_exposures = False; gcv.graphics_exposures = False;
gc = XCreateGC(d, w, GCGraphicsExposures, &gcv); gc = XCreateGC(d, w, GCGraphicsExposures, &gcv);
} }