ilo: unmap cp bo before destroying it

The BOs are mapped in their entire life times for the chipsets we support so
do not forget to unmap it.
This commit is contained in:
Chia-I Wu 2013-06-04 13:25:38 +08:00
parent 27804b2fc7
commit 7cbf0a410e

View 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);