X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Frender.c;h=4735ec51a948a385a1d6116ecfcc474b9dddc938;hb=de4f92ccc66c1dad1a2820a07d1f0161bd61a855;hp=ea1c79d91339df92ee0c6a114dc74f4878773280;hpb=b95d97795173f188477729016f6f080bc8f9f818;p=chaz%2Fopenbox diff --git a/render/render.c b/render/render.c index ea1c79d9..4735ec51 100644 --- a/render/render.c +++ b/render/render.c @@ -16,7 +16,7 @@ #endif static void pixel_data_to_pixmap(RrAppearance *l, - gint x, gint y, gint w, gint h); + gint x, gint y, gint w, gint h); void RrPaint(RrAppearance *l, Window win, gint w, gint h) { @@ -143,6 +143,7 @@ RrAppearance *RrAppearanceCopy(RrAppearance *orig) { RrSurface *spo, *spc; RrAppearance *copy = g_new(RrAppearance, 1); + gint i; copy->inst = orig->inst; @@ -195,6 +196,11 @@ RrAppearance *RrAppearanceCopy(RrAppearance *orig) copy->textures = orig->textures; copy->texture = g_memdup(orig->texture, orig->textures * sizeof(RrTexture)); + for (i = 0; i < copy->textures; ++i) + if (copy->texture[i].type == RR_TEXTURE_RGBA) { + g_free(copy->texture[i].data.rgba.cache); + copy->texture[i].data.rgba.cache = NULL; + } copy->pixmap = None; copy->xftdraw = NULL; copy->w = copy->h = 0; @@ -203,10 +209,17 @@ RrAppearance *RrAppearanceCopy(RrAppearance *orig) void RrAppearanceFree(RrAppearance *a) { + gint i; + if (a) { RrSurface *p; if (a->pixmap != None) XFreePixmap(RrDisplay(a->inst), a->pixmap); if (a->xftdraw != NULL) XftDrawDestroy(a->xftdraw); + for (i = 0; i < a->textures; ++i) + if (a->texture[i].type == RR_TEXTURE_RGBA) { + g_free(a->texture[i].data.rgba.cache); + a->texture[i].data.rgba.cache = NULL; + } if (a->textures) g_free(a->texture); p = &a->surface;