Evas filters: Fix massive memleak with async sw render
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 18 Aug 2015 06:11:23 +0000 (15:11 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 18 Aug 2015 09:31:39 +0000 (18:31 +0900)
Oooops, the flag stolen meant that we don't hold any reference on
this buffer anymore, which meant we should not increase the refcount
here!

@fix

src/lib/evas/filters/evas_filter.c

index 75e36a4..5499608 100644 (file)
@@ -503,7 +503,7 @@ _filter_buffer_data_set(Evas_Filter_Context *ctx, int bufid, void *data,
    fb->h = h;
 
    fb->backing = _rgba_image_alloc(fb, data);
-   fb->allocated = (!data && (fb->backing != NULL));
+   fb->allocated = (fb->backing != NULL);
    return fb->allocated;
 }
 
@@ -606,14 +606,12 @@ evas_filter_buffer_backing_steal(Evas_Filter_Context *ctx, int bufid)
    buffer = _filter_buffer_get(ctx, bufid);
    if (!buffer) return NULL;
 
+   // we don't hold any reference on this buffer anymore
    buffer->stolen = EINA_TRUE;
 
    if (ctx->gl_engine)
      return buffer->glimage;
 
-   if (ctx->async && buffer->backing)
-     buffer->backing->cache_entry.references++;
-
    return buffer->backing;
 }