gallium/util: correctly unref a buffer in u_prim_restart
authorMarek Olšák <marek.olsak@amd.com>
Wed, 15 Feb 2017 14:04:51 +0000 (15:04 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 18 Feb 2017 00:22:08 +0000 (01:22 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/util/u_prim_restart.c

index a4d7c1433d97ca8e3bc0c6b9efc76c6cb3232fa8..e45aa562a4faab68f7f6fe4afd5c32e5f2787130 100644 (file)
@@ -117,7 +117,7 @@ error:
    if (dst_transfer)
       pipe_buffer_unmap(context, dst_transfer);
    if (*dst_buffer)
-      screen->resource_destroy(screen, *dst_buffer);
+      pipe_resource_reference(dst_buffer, NULL);
    return PIPE_ERROR_OUT_OF_MEMORY;
 }