Leak was introduced when fixing strict aliasing violation in this code:
the reference counting was preserved, but the destructor call on zero
reference count was not.
hwtnl->cmd.prim_count = 0;
}
- /*
- * FIXME: Somehow we are accumulating too many buffer uploads without
- * flushing, so temporarily disable buffer upload coalescing to prevent OOM
- * crashes (at expense of less performance).
- */
- svga_context_flush_buffers(svga);
-
return PIPE_OK;
}
{
SVGA3dCopyBox *boxes;
unsigned i;
+ struct pipe_resource *dummy;
assert(sbuf->handle);
assert(sbuf->hwbuf);
sbuf->dma.svga = NULL;
sbuf->dma.boxes = NULL;
- /* Decrement reference count */
- pipe_reference(&(sbuf->b.b.reference), NULL);
- sbuf = NULL;
+ /* Decrement reference count (and potentially destroy) */
+ dummy = &sbuf->b.b;
+ pipe_resource_reference(&dummy, NULL);
}