i965/miptree: Don't leak the clear_color_bo
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 9 Apr 2018 18:27:08 +0000 (11:27 -0700)
committerNanley Chery <nanley.g.chery@intel.com>
Sat, 21 Apr 2018 00:14:37 +0000 (17:14 -0700)
Free the clear_color_bo in addition to freeing the
intel_miptree_aux_buffer which holds the reference to it.

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index 8d3ddd5654406bba791e5ec089abd082b1fe4940..0580cc053463e273c8aae3b1b12856583bcf49ae 100644 (file)
@@ -2877,8 +2877,7 @@ intel_miptree_make_shareable(struct brw_context *brw,
                                 ISL_AUX_USAGE_NONE, false);
 
    if (mt->mcs_buf) {
-      brw_bo_unreference(mt->mcs_buf->bo);
-      free(mt->mcs_buf);
+      intel_miptree_aux_buffer_free(mt->mcs_buf);
       mt->mcs_buf = NULL;
 
       /* Any pending MCS/CCS operations are no longer needed. Trying to