OSDN Git Service

Merge freedesktop/master into otc-private/master
[android-x86/external-mesa.git] / src / gallium / drivers / ilo / ilo_cp.c
index 1fd4741..b29a014 100644 (file)
@@ -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);