summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/ilo/ilo_cp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/ilo/ilo_cp.c b/src/gallium/drivers/ilo/ilo_cp.c
index 1fd47410bcd..b29a014591c 100644
--- a/src/gallium/drivers/ilo/ilo_cp.c
+++ b/src/gallium/drivers/ilo/ilo_cp.c
@@ -256,8 +256,13 @@ ilo_cp_flush(struct ilo_cp *cp)
void
ilo_cp_destroy(struct ilo_cp *cp)
{
- if (cp->bo)
+ if (cp->bo) {
+ if (!cp->sys)
+ cp->bo->unmap(cp->bo);
+
cp->bo->unreference(cp->bo);
+ }
+
if (cp->render_ctx)
cp->winsys->destroy_context(cp->winsys, cp->render_ctx);